repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
moved code that handles the previous keypress
[deb_libcec.git]
/
src
/
lib
/
CECClient.cpp
diff --git
a/src/lib/CECClient.cpp
b/src/lib/CECClient.cpp
index c9525af15ace48fd132a3c78771d65873fdf79ee..0bbc081191652ba7b65a80bb88bd2070d5358e40 100644
(file)
--- a/
src/lib/CECClient.cpp
+++ b/
src/lib/CECClient.cpp
@@
-972,9
+972,14
@@
void CCECClient::AddKey(void)
void CCECClient::AddKey(const cec_keypress &key)
{
void CCECClient::AddKey(const cec_keypress &key)
{
+ // send back the previous key if there is one
+ AddKey();
+
{
CLockObject lock(m_mutex);
{
CLockObject lock(m_mutex);
- m_iCurrentButton = key.duration > 0 ? CEC_USER_CONTROL_CODE_UNKNOWN : key.keycode;
+ m_iCurrentButton = key.duration > 0 || key.keycode > CEC_USER_CONTROL_CODE_MAX ?
+ CEC_USER_CONTROL_CODE_UNKNOWN :
+ key.keycode;
m_buttontime = key.duration > 0 ? 0 : GetTimeMs();
}
m_buttontime = key.duration > 0 ? 0 : GetTimeMs();
}