lr-81 : how to map keys to a gamepad for all games at once?
-
Pi Model or other hardware: Raspberry Pi 4B and PC Intel NUC8i7HVKVA
RetroPie Version Used: 4.8.7 (on both machines; the PC is under Ubuntu 23.10)
Controller used: USB (French) keyboard + random cheap chinese clone of a PS3 USB gamepad.
Guide used: https://retropie.org.uk/docs/RetroArch-Configuration/
Important detail: My ZX81 games are sorted in alphabetical subrirectories: "0-9", "A", "B", "C"...I want to use my gamepad to play games on ZX81, a machine that was manufactured without any gamepad support. In most games, you move your hero from the keyboard keys "5" (Left), "8" (Right), "6" (down) and 7 (up). So, my simple idea is to map these ZX81 keyboard's keys to the respective D-Pad buttons on my gamepad.
To do this, I used RGUI menu. I went to Quick Menu > Core Options and made the following assignments:
Joypad Left mapping -> 5
Joypad Right mapping -> 8
Joypad Up mapping -> 7
Joypad Down mapping -> 6Problem: I can save this configuration for the current folder only. Here, I was doing it from a game in the "A" subdirectory.
THe configuration file is saved to: /opt/retropie/configs/all/retroarch/config/EightyOne/A.opt
Here is its main content:... 81_joypad_down = "6" 81_joypad_left = "5" 81_joypad_right = "8" 81_joypad_up = "7"
This works, but is limited to the directory "A".
How to assign it to the ~/RetroPie/roms/zx81 and all its subdirectories?Here are the two other methods I tried:
1/ Using the RGUI menu to change keys
I first deleted the previous file /opt/retropie/configs/all/retroarch/config/EightyOne/A.opt
Quick Menu > Keys > Port 1 keys >
Type of device : Retropad
But it's Impossible here to assign anything to gamepad buttons.Quick Menu > Keys > Port 2 keys >
Type of device : Sinclair Keyboard
D-Pad up -> 7
D-Pad down -> 6
D-Pad left -> 5
D-Pad right -> 8It saves this confituguration to: /opt/retropie/configs/zx81/EightyOne/EightyOne.rmp
here is the main content of the file:
... input_libretro_device_p1 = "1" input_libretro_device_p2 = "259" ... input_player2_key_down = "54" input_player2_key_left = "53" input_player2_key_right = "56" input_player2_key_up = "55" ... input_remap_port_p1 = "0" input_remap_port_p2 = "1" ...
Result: it does nothing.
D-Pad buttons up/down/left/right on my Joypad don't move the cursor. But keys 5, 6, 7 and 8 on my USB keyboard (NOT numpad) do it.Actually, I wonder what this EightyOne.rmp configuration file was supposed to do exactly? For instance, this line:
input_player2_key_down = "54"
...is it supposed to:
- make button "down" on my Joypad behave as the key number "54" on my keyboard (so pressing the joypad DOWN D-Pad button to print "6" on screen)?
or:
- the opposite, make key number "54" on my keyboard (so key "6") behave like a "going down" D-Pad button from a joypad (so pressing the "6" key should no more print "6" on screen)?
And why does it execute none of these options at the end?
By the way, where can i find the corresponding table between a key (for instance "6") and its Retroarch coding number ("54")?
The page at https://retropie.org.uk/docs/RetroArch-Configuration/ doesn't answer to any of these simple questions. Confusing.
2/ Second method, I tried to manually edit file /opt/retropie/configs/zx81/retroarch.cfg
But it was too confusing.I found these lines:
input_player1_left = "nul" input_player1_left_btn = "nul" input_player1_right = "nul" input_player1_right_btn = "nul" input_player1_up = "nul" input_player1_up_btn = "nul" input_player1_down = "nul" input_player1_down_btn = "nul" ... keyboard_gamepad_enable = "true" keyboard_gamepad_mapping_type = "1"
...But I have no idea what to put in front of what. For instance, in front of "input_player1_down =". Should I put "6"? Should I put "54"?
And, as before, I don't know if it would attribute the function of key '6' to D-Pad button DOWN on joypad (so using joypad to print '6' on screen) or would it do the opposite (erase original function of key '6' on keyboard to make it act as a button DOWN on Joypad)?
Again, the page at https://retropie.org.uk/docs/RetroArch-Configuration/ doesn't explain anything about these topics.
To be honest, this problem is not specific to lr-81. I'm confused the same exact way to configure keys on all emulated computers that are using a keyboard.
Even more, sometimes, I would like to assign a keyboard key to another. For instance, here, I would like to assign fonction of ZX81 keys "5", "6", "7" and "8" to the cursor key of my USB keyboard. But I have no clue how to do it.
May I suggest this part of the Retropie documentation - https://retropie.org.uk/docs/RetroArch-Configuration/ - should be extended?
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.