KEYMAPPER: Add DPAD_CENTER as hardware input source

And define an event for it as a JoystickButton

Some controllers produce this key press with their DPAD, typically to select and interact with options.
See: https://developer.android.com/develop/ui/views/touch-and-input/game-controllers/controller-input
Fire TV remote controller is such a contoller.
see: https://developer.amazon.com/docs/fire-tv/remote-input.html
This commit is contained in:
antoniou79 2023-03-25 00:37:09 +02:00 committed by Eugene Sandulenko
parent 9bf6f752f9
commit 093f7d1cd6
2 changed files with 3 additions and 1 deletions

View File

@ -267,6 +267,7 @@ const HardwareInputTableEntry defaultJoystickButtons[] = {
{ "JOY_DOWN", JOYSTICK_BUTTON_DPAD_DOWN, _s("D-pad Down") },
{ "JOY_LEFT", JOYSTICK_BUTTON_DPAD_LEFT, _s("D-pad Left") },
{ "JOY_RIGHT", JOYSTICK_BUTTON_DPAD_RIGHT, _s("D-pad Right") },
{ "JOY_CENTER", JOYSTICK_BUTTON_DPAD_CENTER, _s("D-pad Center") },
{ nullptr, 0, nullptr }
};

View File

@ -158,7 +158,8 @@ enum JoystickButton {
JOYSTICK_BUTTON_DPAD_UP,
JOYSTICK_BUTTON_DPAD_DOWN,
JOYSTICK_BUTTON_DPAD_LEFT,
JOYSTICK_BUTTON_DPAD_RIGHT
JOYSTICK_BUTTON_DPAD_RIGHT,
JOYSTICK_BUTTON_DPAD_CENTER
};
/**