From ff4e1b3e91144c1dc398da13cfd19a5cbf304d0a Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Sun, 22 Jun 2014 12:06:52 +0200 Subject: Added support for remote key "eject". --- system/keymaps/remote.xml | 1 + xbmc/input/ButtonTranslator.cpp | 1 + xbmc/input/XBIRRemote.h | 2 ++ xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 5 ++++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/system/keymaps/remote.xml b/system/keymaps/remote.xml index aff1fcd2ef..12fd85c1e7 100644 --- a/system/keymaps/remote.xml +++ b/system/keymaps/remote.xml @@ -60,6 +60,7 @@ FullScreen PreviousMenu Record + XBMC.EjectTray() VolumeUp VolumeDown Mute diff --git a/xbmc/input/ButtonTranslator.cpp b/xbmc/input/ButtonTranslator.cpp index f4293f73d7..505ed61a3f 100644 --- a/xbmc/input/ButtonTranslator.cpp +++ b/xbmc/input/ButtonTranslator.cpp @@ -1327,6 +1327,7 @@ uint32_t CButtonTranslator::TranslateRemoteString(const char *szButton) else if (strButton.Equals("blue")) buttonCode = XINPUT_IR_REMOTE_BLUE; else if (strButton.Equals("subtitle")) buttonCode = XINPUT_IR_REMOTE_SUBTITLE; else if (strButton.Equals("language")) buttonCode = XINPUT_IR_REMOTE_LANGUAGE; + else if (strButton.Equals("eject")) buttonCode = XINPUT_IR_REMOTE_EJECT; else CLog::Log(LOGERROR, "Remote Translator: Can't find button %s", strButton.c_str()); return buttonCode; } diff --git a/xbmc/input/XBIRRemote.h b/xbmc/input/XBIRRemote.h index 929ffa7cc7..82251c6dfb 100644 --- a/xbmc/input/XBIRRemote.h +++ b/xbmc/input/XBIRRemote.h @@ -93,6 +93,8 @@ #define XINPUT_IR_REMOTE_LIVE_RADIO 248 #define XINPUT_IR_REMOTE_EPG_SEARCH 246 +#define XINPUT_IR_REMOTE_EJECT 235 + // Reserved 256 -> ... // Key.h // KEY_BUTTON_* diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp index 6cd952d005..6950f0c7f9 100644 --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp @@ -1030,8 +1030,11 @@ void CPeripheralCecAdapter::PushCecKeypress(const cec_keypress &key) xbmcKey.iButton = XINPUT_IR_REMOTE_SUBTITLE; PushCecKeypress(xbmcKey); break; - case CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION: case CEC_USER_CONTROL_CODE_EJECT: + xbmcKey.iButton = XINPUT_IR_REMOTE_EJECT; + PushCecKeypress(xbmcKey); + break; + case CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION: case CEC_USER_CONTROL_CODE_INPUT_SELECT: case CEC_USER_CONTROL_CODE_INITIAL_CONFIGURATION: case CEC_USER_CONTROL_CODE_HELP: -- cgit v1.2.3