From 6710d300ded40bf47eef036513b757bf3b8651a7 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Fri, 14 Oct 2011 16:17:08 +0200 Subject: [PATCH] cec: send a keypress with 0 duration when a key is pressed and with a duration set when it's released --- src/lib/LibCEC.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/LibCEC.cpp b/src/lib/LibCEC.cpp index a1f2650..7c0f792 100644 --- a/src/lib/LibCEC.cpp +++ b/src/lib/LibCEC.cpp @@ -251,6 +251,13 @@ void CLibCEC::SetCurrentButton(cec_user_control_code iButtonCode) { m_iCurrentButton = iButtonCode; m_buttontime = GetTimeMs(); + + /* push keypress to the keybuffer with 0 duration. + push another press to the keybuffer with the duration set when the button is released */ + cec_keypress key; + key.duration = 0; + key.keycode = m_iCurrentButton; + m_keyBuffer.Push(key); } void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress /*= CEC::CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS */) -- 2.34.1