Input: Let the key mapping dialog see volume keys, mapped or not

The volume key filter in NativeKey left unmapped volume keys to the OS, so
they never reached the dialog and couldn't be mapped. A new InputMode::AllKeys
lets a screen ask for them; the dialog consumes them so the volume doesn't
change while mapping.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-22 00:01:34 +02:00
1 parent 598645db08
commit c51bcd458c
3 files changed
+14 -6

No files matched your search

+9 -6
View File
@@ -1639,15 +1639,18 @@ bool NativeKey(const KeyInput &key) {
// Leave volume keys to the OS, unless they're mapped (to L/R for example). Then they also reach the menus,
// and in game we consume them, repeats included, so the OS doesn't change the volume as well.
bool mappedVolumeKey = false;
// The key mapping dialog gets them all (to be able to map them), and consumes them too.
bool volumeKey = false;
bool consumeVolumeKey = false;
switch (key.keyCode) {
case NKCODE_VOLUME_DOWN:
case NKCODE_VOLUME_UP:
case NKCODE_VOLUME_MUTE:
if (!KeyMap::InputMappingToPspButton(InputMapping(key.deviceId, key.keyCode), nullptr)) {
if (!(inputMode & InputMode::AllKeys) && !KeyMap::InputMappingToPspButton(InputMapping(key.deviceId, key.keyCode), nullptr)) {
return false;
}
mappedVolumeKey = true;
volumeKey = true;
consumeVolumeKey = inputMode & (InputMode::Other | InputMode::AllKeys);
break;
default:
break;
@@ -1719,7 +1722,7 @@ bool NativeKey(const KeyInput &key) {
retval = false;
break;
case UI::KeyEventResult::IGNORE_KEY:
return mappedVolumeKey && (inputMode & InputMode::Other);
return consumeVolumeKey;
}
// Queue up the key event for synchronous processing in the UI.
@@ -1736,8 +1739,8 @@ bool NativeKey(const KeyInput &key) {
// Tell the caller that we handled the key.
retval = true;
}
if (mappedVolumeKey) {
retval = inputMode & InputMode::Other;
if (volumeKey) {
retval = consumeVolumeKey;
}
return retval;