Skip to content

Commit 2277b39

Browse files
committed
joy2key: fix generic mappings definition
Besides the mappings parsed from RetroArch's auto-configuration profiles, there's a generic mapping used for gamepads that don't have a profile saved. Unfortunately this never worked, since the initialization of the mapping - in the `add_mappings` function - had the buttons and hats parameters switched. This changeset fixes this, creating a correct mapping. The issue was reported in https://retropie.org.uk/forum/topic/35063/, `joy2key_sdl` would crash with a Python3 error since the (wrong) generic mapping would produce the incorrect data type and values for the `filter_active_events` method.
1 parent 06e2ce9 commit 2277b39

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scriptmodules/admin/joy2key/joy2key_sdl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ def get_all_ra_config(def_buttons: list) -> list:
196196
generic_dev = InputDev("*", "*")
197197
generic_dev.add_mappings(
198198
{}, # no axis
199-
{0: [(1, 'up'), (8, 'left'), (4, 'down'), (2, 'right')]}, # D-Pad as 'hat0'
200-
{0: 'b', 1: 'a', 3: 'y', 4: 'x'} # 4 buttons
199+
{0: 'b', 1: 'a', 3: 'y', 4: 'x'}, # 4 buttons
200+
{0: [(1, 'up'), (8, 'left'), (4, 'down'), (2, 'right')]} # 1 D-Pad as 'hat0'
201201
)
202202
ra_config_list.append(generic_dev)
203203
js_cfg_dir = CONFIG_DIR + '/all/retroarch-joypads/'

0 commit comments

Comments
 (0)