void CCECClient::AddKey(const cec_keypress &key)
{
- if (key.keycode > CEC_USER_CONTROL_CODE_MAX &&
+ if (key.keycode > CEC_USER_CONTROL_CODE_MAX ||
key.keycode < CEC_USER_CONTROL_CODE_SELECT)
{
// send back the previous key if there is one
int64_t now = GetTimeMs();
if (m_lastKeypress.keycode != key.keycode ||
key.duration > 0 ||
- now - m_iLastKeypressTime >= m_configuration.iDoubleTapTimeoutMs)
+ now - m_iLastKeypressTime >= m_configuration.iDoubleTapTimeoutMs * DOUBLE_TAP_TIMEOUT_UNIT_SIZE)
{
// no double tap
if (key.duration == 0)