repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix typo in rejecting invalid keycodes
[deb_libcec.git]
/
src
/
lib
/
CECClient.cpp
diff --git
a/src/lib/CECClient.cpp
b/src/lib/CECClient.cpp
index d0699130cd303a6bc247351edd318653ce7cdd5a..837214f456f54e724c29032664087064875874f9 100644
(file)
--- a/
src/lib/CECClient.cpp
+++ b/
src/lib/CECClient.cpp
@@
-1,7
+1,7
@@
/*
* This file is part of the libCEC(R) library.
*
/*
* This file is part of the libCEC(R) library.
*
- * libCEC(R) is Copyright (C) 2011-201
2
Pulse-Eight Limited. All rights reserved.
+ * libCEC(R) is Copyright (C) 2011-201
3
Pulse-Eight Limited. All rights reserved.
* libCEC(R) is an original work, containing original code.
*
* libCEC(R) is a trademark of Pulse-Eight Limited.
* libCEC(R) is an original work, containing original code.
*
* libCEC(R) is a trademark of Pulse-Eight Limited.
@@
-822,6
+822,7
@@
bool CCECClient::GetCurrentConfiguration(libcec_configuration &configuration)
configuration.wakeDevices = m_configuration.wakeDevices;
configuration.powerOffDevices = m_configuration.powerOffDevices;
configuration.bPowerOffScreensaver = m_configuration.bPowerOffScreensaver;
configuration.wakeDevices = m_configuration.wakeDevices;
configuration.powerOffDevices = m_configuration.powerOffDevices;
configuration.bPowerOffScreensaver = m_configuration.bPowerOffScreensaver;
+ configuration.bPowerOnScreensaver = m_configuration.bPowerOnScreensaver;
configuration.bPowerOffOnStandby = m_configuration.bPowerOffOnStandby;
configuration.bSendInactiveSource = m_configuration.bSendInactiveSource;
configuration.logicalAddresses = m_configuration.logicalAddresses;
configuration.bPowerOffOnStandby = m_configuration.bPowerOffOnStandby;
configuration.bSendInactiveSource = m_configuration.bSendInactiveSource;
configuration.logicalAddresses = m_configuration.logicalAddresses;
@@
-888,6
+889,11
@@
bool CCECClient::SetConfiguration(const libcec_configuration &configuration)
m_configuration.comboKey = defaultSettings.comboKey;
m_configuration.iComboKeyTimeoutMs = defaultSettings.iComboKeyTimeoutMs;
}
m_configuration.comboKey = defaultSettings.comboKey;
m_configuration.iComboKeyTimeoutMs = defaultSettings.iComboKeyTimeoutMs;
}
+
+ if (m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_1_0)
+ m_configuration.bPowerOnScreensaver = configuration.bPowerOnScreensaver;
+ else
+ m_configuration.bPowerOnScreensaver = defaultSettings.bPowerOnScreensaver;
}
bool bNeedReinit(false);
}
bool bNeedReinit(false);
@@
-967,10
+973,10
@@
void CCECClient::AddKey(bool bSendComboKey /* = false */)
{
key.duration = (unsigned int) (GetTimeMs() - m_buttontime);
{
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;
{
key.keycode = m_iCurrentButton;
@@
-989,7
+995,7
@@
void CCECClient::AddKey(bool bSendComboKey /* = false */)
void CCECClient::AddKey(const cec_keypress &key)
{
void CCECClient::AddKey(const cec_keypress &key)
{
- if (key.keycode > CEC_USER_CONTROL_CODE_MAX
&&
+ if (key.keycode > CEC_USER_CONTROL_CODE_MAX
||
key.keycode < CEC_USER_CONTROL_CODE_SELECT)
{
// send back the previous key if there is one
key.keycode < CEC_USER_CONTROL_CODE_SELECT)
{
// send back the previous key if there is one
@@
-1003,7
+1009,7
@@
void CCECClient::AddKey(const cec_keypress &key)
{
CLockObject lock(m_mutex);
{
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)
{
// stop + ok -> exit
if (key.keycode == CEC_USER_CONTROL_CODE_SELECT)
@@
-1064,7
+1070,7
@@
void CCECClient::CheckKeypressTimeout(void)
m_configuration.iComboKeyTimeoutMs : CEC_DEFAULT_COMBO_TIMEOUT_MS);
if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN &&
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 && i
TimeoutMs > 0 && i
Now - m_buttontime > iTimeoutMs) ||
(m_iCurrentButton != comboKey && iNow - m_buttontime > CEC_BUTTON_TIMEOUT)))
{
key.duration = (unsigned int) (iNow - m_buttontime);
(m_iCurrentButton != comboKey && iNow - m_buttontime > CEC_BUTTON_TIMEOUT)))
{
key.duration = (unsigned int) (iNow - m_buttontime);