Skip to content

Commit

Permalink
Skip double press removal. It is handled through other means.
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Nov 3, 2014
1 parent f65b8d5 commit aa77d2c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
18 changes: 1 addition & 17 deletions src/lib/CECClient.cpp
Expand Up @@ -58,11 +58,8 @@ CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &con
m_releaseButtontime(0),
m_pressedButtoncount(0),
m_releasedButtoncount(0),
m_iPreventForwardingPowerOffCommand(0),
m_iLastKeypressTime(0)
m_iPreventForwardingPowerOffCommand(0)
{
m_lastKeypress.keycode = CEC_USER_CONTROL_CODE_UNKNOWN;
m_lastKeypress.duration = 0;
m_configuration.Clear();
// set the initial configuration
SetConfiguration(configuration);
Expand Down Expand Up @@ -1559,20 +1556,7 @@ void CCECClient::CallbackAddKey(const cec_keypress &key)
{
CLockObject lock(m_cbMutex);
if (m_configuration.callbacks && m_configuration.callbacks->CBCecKeyPress)
{
// prevent double taps
int64_t now = GetTimeMs();
if (m_lastKeypress.keycode != key.keycode ||
key.duration > 0 ||
now - m_iLastKeypressTime >= DoubleTapTimeoutMS())
{
// no double tap
if (key.duration == 0)
m_iLastKeypressTime = now;
m_lastKeypress = key;
m_configuration.callbacks->CBCecKeyPress(m_configuration.callbackParam, key);
}
}
}

void CCECClient::CallbackAddLog(const cec_log_message &message)
Expand Down
2 changes: 0 additions & 2 deletions src/lib/CECClient.h
Expand Up @@ -318,7 +318,5 @@ namespace CEC
int32_t m_pressedButtoncount; /**< the number of times a button released message has been seen for this press. */
int32_t m_releasedButtoncount; /**< the number of times a button pressed message has been seen for this press. */
int64_t m_iPreventForwardingPowerOffCommand; /**< prevent forwarding standby commands until this time */
int64_t m_iLastKeypressTime; /**< last time a key press was sent to the client */
cec_keypress m_lastKeypress; /**< the last key press that was sent to the client */
};
}

0 comments on commit aa77d2c

Please sign in to comment.