From b60a3d77387e19e56afcadafb5dd12e69764b524 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Tue, 14 Feb 2012 17:56:48 +0100 Subject: [PATCH] cec: return the anynet return keycode directly instead of translating it to 'return' for v1.5.0+ clients --- include/cectypes.h | 8 ++------ src/lib/CECProcessor.h | 1 + src/lib/implementations/ANCommandHandler.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/cectypes.h b/include/cectypes.h index 951def4..808fb95 100644 --- a/include/cectypes.h +++ b/include/cectypes.h @@ -466,15 +466,11 @@ typedef enum cec_user_control_code CEC_USER_CONTROL_CODE_F4_YELLOW = 0x74, CEC_USER_CONTROL_CODE_F5 = 0x75, CEC_USER_CONTROL_CODE_DATA = 0x76, - CEC_USER_CONTROL_CODE_MAX = 0x76, + CEC_USER_CONTROL_CODE_AN_RETURN = 0x91, + CEC_USER_CONTROL_CODE_MAX = 0x91, CEC_USER_CONTROL_CODE_UNKNOWN } cec_user_control_code; -typedef enum cec_an_user_control_code -{ - CEC_AN_USER_CONTROL_CODE_RETURN = 0x91 -} cec_an_user_control_code; - typedef enum cec_logical_address { CECDEVICE_UNKNOWN = -1, //not a valid logical address diff --git a/src/lib/CECProcessor.h b/src/lib/CECProcessor.h index 515beed..7ebe93f 100644 --- a/src/lib/CECProcessor.h +++ b/src/lib/CECProcessor.h @@ -84,6 +84,7 @@ namespace CEC virtual bool IsActiveSource(cec_logical_address iAddress); virtual bool IsInitialised(void); virtual bool SetStreamPath(uint16_t iPhysicalAddress); + virtual cec_client_version GetClientVersion(void) const { return m_configuration.clientVersion; }; virtual bool SetActiveView(void); virtual bool SetActiveSource(cec_device_type type = CEC_DEVICE_TYPE_RESERVED); diff --git a/src/lib/implementations/ANCommandHandler.cpp b/src/lib/implementations/ANCommandHandler.cpp index d3318a1..f8a8ade 100644 --- a/src/lib/implementations/ANCommandHandler.cpp +++ b/src/lib/implementations/ANCommandHandler.cpp @@ -54,8 +54,10 @@ bool CANCommandHandler::HandleVendorRemoteButtonDown(const cec_command &command) switch (command.parameters[0]) { - case CEC_AN_USER_CONTROL_CODE_RETURN: - key.keycode = CEC_USER_CONTROL_CODE_EXIT; + case CEC_USER_CONTROL_CODE_AN_RETURN: + key.keycode = m_processor->GetClientVersion() >= CEC_CLIENT_VERSION_1_5_0 ? + CEC_USER_CONTROL_CODE_AN_RETURN : + CEC_USER_CONTROL_CODE_EXIT; break; default: break; -- 2.34.1