feat(input_manager): add dualshock 4 and dualsence mapping

Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
2025-06-11 17:53:08 +05:00
parent 7e9a0be150
commit b9d7fc2326

View File

@ -34,11 +34,13 @@ class MainWindowProtocol(Protocol):
current_exec_line: str | None
current_add_game_dialog: QDialog | None
# Mapping of actions to evdev button codes, includes PlayStation, Xbox, and Switch controllers
# Mapping of actions to evdev button codes, includes PlayStation, Xbox controllers
# https://github.com/torvalds/linux/blob/master/drivers/hid/hid-playstation.c
# https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c
BUTTONS = {
'confirm': {ecodes.BTN_A},
'back': {ecodes.BTN_B},
'add_game': {ecodes.BTN_Y},
'confirm': {ecodes.BTN_A, ecodes.BTN_SOUTH},
'back': {ecodes.BTN_B, ecodes.BTN_EAST},
'add_game': {ecodes.BTN_Y, ecodes.BTN_NORTH},
'prev_tab': {ecodes.BTN_TL},
'next_tab': {ecodes.BTN_TR},
'confirm_stick': {ecodes.BTN_THUMBL, ecodes.BTN_THUMBR},