Log In  


I've got Pico-8 running nicely on my Raspberry Pi through Retropie/Emulation Station now, but there's one minor annoyance.

It's a bit of a faff to have to reach over to the keyboard to hit Ctrl-R to start a game or Windows+Q to exit back to ES. It'd be really handy to be able to map those commands to a couple of the spare buttons on my arcade stick.

I see there's a file called sdl_controllers.txt, containing the text // add SDL2 game controller mappings to this file, but that's ALL it says. There are no clues as to what it wants that file to contain in order to map anything. config.txt also includes these lines:

// Custom keyboard scancodes for buttons. player0 0..6, player1 0..5
button_keys 0 0 0 0 0 0 0 0 0 0 0 0 0

but again, heaven knows what that means. KEYCONFIG is no good, it only lets you redefine the two Pico controller action buttons, not the other ones on my arcade stick.

Can anyone help?



If you want to map CTRL+R to a joystick key, this is not something Pico-8 can do, BlinkyMcGoo. You will have to refer to a program that intercepts your keyboard to a joystick stroke.

If you don't mind a bit of complexity, I always use a 100% Freeware program called "AutoHotKey."

It's quite comprehensive and will cover what you need:

https://www.autohotkey.com/

If you just want to configure the joystick with normal buttons such as arrows and (O) or (X), type KEYCONFIG under immediate mode in Pico-8 to reconfigure your joystick. I don't know if it will intercept a true joystick, you will have to check to see if that is possible.


AutoHotKey seems to be for Windows, so I don't see that it'll be any use for my Raspberry Pi :(


Oh, that's hardware I've never used before. Hmm ...

This may cover what you need:

https://sourceforge.net/projects/linuxjoymap/


It does, yes, but it only works on Retroarch cores, which Pico-8 isn't.


Custom keys support is built-in to X server! My first laptop had custom buttons on the front and above the keyboard (on windows, they turned wifi on/off, launched e-mail program, etc), and I was able to remap them to music play/pause and next :)

This guide could help: https://wiki.archlinux.org/index.php/Xmodmap
But if you find it too complicated, you can use the tool that dw817 posted, or run sudo apt install joystick jstest-gtk to install tools from the official repository.


I don't understand a single word of that guide, I'm afraid :( I can't even tell if it's for a Raspberry Pi or Windows or Linux or what.

And the joymap prog I've no clue what to do with. I've got a Windows PC and a Raspberry Pi and it doesn't look like it'll run on either of those.


Yes, the sudo apt command was for the raspberry pi!



[Please log in to post a comment]