From: Lars Op den Kamp Date: Tue, 14 May 2013 23:27:54 +0000 (+0200) Subject: fixed comboKeyTimeout=0. closes #168 X-Git-Tag: upstream/2.2.0~1^2~3^2~43 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cd600c59f7a642a64e01603fadf9743940672b4d;p=deb_libcec.git fixed comboKeyTimeout=0. closes #168 --- diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp index 4db7fcd..85df46d 100644 --- a/src/lib/CECClient.cpp +++ b/src/lib/CECClient.cpp @@ -973,10 +973,10 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */) { key.duration = (unsigned int) (GetTimeMs() - m_buttontime); - cec_user_control_code comboKey(m_configuration.comboKey); - uint32_t iTimeoutMs(m_configuration.iComboKeyTimeoutMs); - - if (key.duration > iTimeoutMs || m_iCurrentButton != comboKey || bSendComboKey) + if (key.duration > m_configuration.iComboKeyTimeoutMs || + m_configuration.iComboKeyTimeoutMs == 0 || + m_iCurrentButton != m_configuration.comboKey || + bSendComboKey) { key.keycode = m_iCurrentButton; @@ -1009,7 +1009,7 @@ void CCECClient::AddKey(const cec_keypress &key) { CLockObject lock(m_mutex); - if (m_iCurrentButton == comboKey && key.duration == 0) + if (m_configuration.iComboKeyTimeoutMs > 0 && m_iCurrentButton == comboKey && key.duration == 0) { // stop + ok -> exit if (key.keycode == CEC_USER_CONTROL_CODE_SELECT) @@ -1070,7 +1070,7 @@ void CCECClient::CheckKeypressTimeout(void) m_configuration.iComboKeyTimeoutMs : CEC_DEFAULT_COMBO_TIMEOUT_MS); if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && - ((m_iCurrentButton == comboKey && iNow - m_buttontime > iTimeoutMs) || + ((m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_buttontime > iTimeoutMs) || (m_iCurrentButton != comboKey && iNow - m_buttontime > CEC_BUTTON_TIMEOUT))) { key.duration = (unsigned int) (iNow - m_buttontime);