[input/remote] Add buttons "favorites" and "last"

Two buttons from CEC are mapped to other existing buttons: "favorites"
to "menu" and "last channel" to "teletext".  Plumb them into the
xbmc/input/remote translations, so that they can be given their own
meaning in the keymaps, and add the same buttons to the LIRC map for
non-CEC remotes.
This commit is contained in:
Paolo Bonzini 2024-12-28 13:55:17 +01:00
parent 953b28eb12
commit 50cbf0481e
5 changed files with 21 additions and 2 deletions

View File

@ -600,6 +600,8 @@
<blue>KEY_BLUE</blue>
<recordedtv>KEY_PVR</recordedtv>
<liveradio>KEY_RADIO</liveradio>
<favorites>KEY_FAVORITES</favorites>
<last>KEY_LAST</last>
</remote>
<remote device="devinput-32">
@ -660,6 +662,8 @@
<blue>KEY_BLUE</blue>
<recordedtv>KEY_PVR</recordedtv>
<liveradio>KEY_RADIO</liveradio>
<favorites>KEY_FAVORITES</favorites>
<last>KEY_LAST</last>
</remote>
<remote device="devinput-64">
@ -720,5 +724,7 @@
<blue>KEY_BLUE</blue>
<recordedtv>KEY_PVR</recordedtv>
<liveradio>KEY_RADIO</liveradio>
<favorites>KEY_FAVORITES</favorites>
<last>KEY_LAST</last>
</remote>
</lircmap>

View File

@ -75,6 +75,7 @@
<eight>JumpSMS8</eight>
<nine>JumpSMS9</nine>
<print>Screenshot</print>
<favorites>ActivateWindow(FavouritesBrowser)</favorites>
</remote>
</global>
<Home>
@ -712,4 +713,9 @@
<title>PlayerProcessInfo</title>
</remote>
</PlayerProcessInfo>
<FullScreenLiveTV>
<remote>
<last>Number0</last>
</remote>
</FullScreenLiveTV>
</keymap>

View File

@ -299,6 +299,10 @@ uint32_t CIRTranslator::TranslateString(std::string strButton)
buttonCode = XINPUT_IR_REMOTE_DVD_MENU;
else if (strButton == "print")
buttonCode = XINPUT_IR_REMOTE_PRINT;
else if (strButton == "favorites")
buttonCode = XINPUT_IR_REMOTE_FAVORITE_MENU;
else if (strButton == "last")
buttonCode = XINPUT_IR_REMOTE_LAST;
else
CLog::Log(LOGERROR, "Remote Translator: Can't find button {}", strButton);
return buttonCode;

View File

@ -86,6 +86,9 @@
#define XINPUT_IR_REMOTE_PRINT 240
#define XINPUT_IR_REMOTE_FAVORITE_MENU 241
#define XINPUT_IR_REMOTE_LAST 242
// Reserved 256 -> ...
// Key.h
// KEY_BUTTON_*

View File

@ -926,7 +926,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const cec_keypress& key)
PushCecKeypress(xbmcKey);
break;
case CEC_USER_CONTROL_CODE_FAVORITE_MENU:
xbmcKey.iButton = XINPUT_IR_REMOTE_MENU;
xbmcKey.iButton = XINPUT_IR_REMOTE_FAVORITE_MENU;
PushCecKeypress(xbmcKey);
break;
case CEC_USER_CONTROL_CODE_EXIT:
@ -946,7 +946,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const cec_keypress& key)
PushCecKeypress(xbmcKey);
break;
case CEC_USER_CONTROL_CODE_PREVIOUS_CHANNEL:
xbmcKey.iButton = XINPUT_IR_REMOTE_TELETEXT;
xbmcKey.iButton = XINPUT_IR_REMOTE_LAST;
PushCecKeypress(xbmcKey);
break;
case CEC_USER_CONTROL_CODE_SOUND_SELECT: