Mapping a keyboard key to the gamepad(s)?
-
Check out LinuxJoystickMapper.
I have it setup right now to map my controller to keyboard inputs when I launch the PPSSPP emulator.
-
@Concat said in Mapping a keyboard key to the gamepad(s)?:
Check out LinuxJoystickMapper.
I have it setup right now to map my controller to keyboard inputs when I launch the PPSSPP emulator.
Did you set this up on a Raspberry Pi? How did you do it? Thanks!
-
Hey @Concat were you asking about mapping a keyboard key in Videopac? or another emulator?
-
Uhhh, I wasn't asking anything (?)
Was just suggesting that if Retroarch doesn't have the appropriate options to map keyboards keys to a gamepad, that he could look at LinuxJoystickMapper.
-
I have installed Linux Joystick Mapper (latest version 0.3.1) by following the steps in this post:
http://blog.petrockblock.com/forums/topic/mapping-a-game-controller-in-kodi/I have also created a very simple mapping file to map the keyboard "1"-key to a button on my 8bitdo NES30 Pro controller:
button vendor=0x3820 product=0x0009 src=3 target=kbd button="1"
After this, I can start the mapper binary just fine and get this output:
pi@retropie:~ $ sudo /home/pi/joymap/loadmap /home/pi/joymap/keyboard-8bitdo.map 0 joysticks. Found device 8Bitdo NES30 Pro (vendor=0x3820, product=0x0009) Found device JOYMAP Code Device (vendor=0x00ff, product=0x0000) 2 button assignments. 0 axes assignments.
However, while the above is running, Emulation station and RetroArch do not respond to my 8bitdo controller at all. It seems that Linux Joystick Mapper "reserves" the original controller to create a virtual device "JOYMAP Code Device" and this JOYMAP Code Device itself is not known by RetroArch.
Did anyone get this working?
-
You're on the right track... but what you need to do is to run loadmap when the emulator is launched, and to kill the loadmap when the emulator exits.
You can do this in the emulators.cfg file. Have a look at this thread. dudleydes was the one who helped me get it running: https://retropie.org.uk/forum/topic/2032/dosbox-mapping-mouse-to-ps3-analog-stick/17
Since you have only mapped one button to the key "1", that's literally the only thing that EmulationStation and Retroarch can see - a keypress of 1. All other buttons are "blocked" for lack of a better term. So if you want to use the mapper, you have to map everything you need to control the emulator - not just one button mapping.
And if you map to joypad buttons, I think it takes another js slot, not the original js slot that the controller uses. The developer explained that his scripts prevents programs from seeing the input from the original js slot until the loadmap is killed. Something like that anyway. Check out the wiki on the sourceforge page to see the discussions.
-
have you been able to get it to work.
i have been messing with it, and i just seem to get it to launch with the mapper.
-
You can also use this alternative method as well:
https://github.com/retropie/retropie-setup/wiki/Universal-Controller-Calibration-&-Mapping-Using-xboxdrv -
i know, i just like being able to reconnect my controller if i have to shut it down.
but im thinking that might be the only way i can get the key mapped :( -
@ExarKunIv said in Mapping a keyboard key to the gamepad(s)?:
have you been able to get it to work.
i have been messing with it, and i just seem to get it to launch with the mapper.
No, I gave up pretty quickly after unsuccesfully messing with Linux Joystick Mapper.
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.