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?

P#70346 2019-11-29 01:07 ( Edited 2019-11-29 02:09)

:: dw817

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:


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.

P#70348 2019-11-29 02:00 ( Edited 2019-11-29 02:02)

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

P#70350 2019-11-29 02:10
:: dw817

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

This may cover what you need:


P#70351 2019-11-29 02:15

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

P#70360 2019-11-29 10:53
:: merwok

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.

P#70369 2019-11-29 15:48

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.

P#70391 2019-11-30 03:19 ( Edited 2019-11-30 03:21)
:: merwok

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

P#80097 2020-07-29 17:05

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2020-08-11 07:22 | 0.013s | 4194k | Q:23