From: Lars Op den Kamp Date: Fri, 9 Nov 2012 13:39:38 +0000 (+0100) Subject: fixed - only set m_iCurrentButton when the duration isn't known yet. fixes duplicate... X-Git-Tag: upstream/2.2.0~1^2~12^2~37 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=74f184d2359c37740931c62cb7b755e1c59dfd4b;p=deb_libcec.git fixed - only set m_iCurrentButton when the duration isn't known yet. fixes duplicate key press for vendor remote codes. closes #81 --- diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp index 004d741..dc4bbd8 100644 --- a/src/lib/CECClient.cpp +++ b/src/lib/CECClient.cpp @@ -964,8 +964,11 @@ void CCECClient::AddKey(const cec_keypress &key) AddKey(true); } - m_iCurrentButton = transmitKey.keycode; - m_buttontime = m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN || key.duration > 0 ? 0 : GetTimeMs(); + if (key.duration == 0) + { + m_iCurrentButton = transmitKey.keycode; + m_buttontime = m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN || key.duration > 0 ? 0 : GetTimeMs(); + } } if (key.keycode != COMBO_KEY || key.duration > 0)