From 74f184d2359c37740931c62cb7b755e1c59dfd4b Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Fri, 9 Nov 2012 14:39:38 +0100 Subject: [PATCH] fixed - only set m_iCurrentButton when the duration isn't known yet. fixes duplicate key press for vendor remote codes. closes #81 --- src/lib/CECClient.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) -- 2.34.1