cec: return the anynet return keycode directly instead of translating it to 'return...
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 14 Feb 2012 16:56:48 +0000 (17:56 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 14 Feb 2012 16:56:48 +0000 (17:56 +0100)
include/cectypes.h
src/lib/CECProcessor.h
src/lib/implementations/ANCommandHandler.cpp

index 951def42b0f9a6f62514dfa206cd5904bc84ff29..808fb95a15fc7b8c13945d12907bbfd329fc7a0b 100644 (file)
@@ -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
index 515beed4bd35dc5aeddb0b7a0d267e39463d55ce..7ebe93fb8336c8ff16cf924b16c99e54e3581d7c 100644 (file)
@@ -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);
index d3318a18dff928d103c86da4b586f8bc4247dc1c..f8a8ade3c421aa12d00f781b03978eb1706dc9ba 100644 (file)
@@ -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;