How to map keyboard keys to joypad buttons?

Area for discussing ST(E) clones

Moderators: Mug UK, Zorro 2, Greenious, spiny, Moderator Team

freetz
Atarian
Atarian
Posts: 1
Joined: Sun Feb 26, 2017 11:22 am

How to map keyboard keys to joypad buttons?

Postby freetz » Sun Feb 26, 2017 11:29 am

Hi everyone,

I'm new to my MiST and love it a lot! Thanks to everyone involved in this amazing piece of hardware!
What I'm looking for is a way to customize joypad/joystick buttons to customizable keyboard keys. As it is possible to send ESCape, Enter and Space keys to each core (which is already really useful), it would be great to customize the keys being sent. For example, when using an Atari 8-Bit core (which I use most), the START, OPTION and SELECT keys are often used to get a game ready to play. These are mapped to function keys on a USB keyboard, but having these mapped to joypad buttons would enable me/us to play games on the MiST without attaching a USB keyboard (hence great for travelling).

I read in a few (older) threads here that this isn't (yet) possible, but wanted to ask if there's a workaround maybe? Even if it would come at the cost of (for example) not having the ESCape key sent but, say, F7?

Thanks for any input and keep up the great work,

F.

User avatar
Newsdee
Atari Super Hero
Atari Super Hero
Posts: 868
Joined: Fri Sep 19, 2014 8:40 am

Re: How to map keyboard keys to joypad buttons?

Postby Newsdee » Mon Feb 27, 2017 2:16 am

Just to clarify, are you trying to make your gamepad act as keyboard right? Not the opposite (use keyboard without gamepad).

The relevant code is in /usb/joy_mapping.c in the firmware. There is a function to map via .ini but its not documented. I don't remember if it's because it doesn't work well or not. But you can try it.

joy_key_map= hex state , ps2 keycode

User avatar
Newsdee
Atari Super Hero
Atari Super Hero
Posts: 868
Joined: Fri Sep 19, 2014 8:40 am

Re: How to map keyboard keys to joypad buttons?

Postby Newsdee » Mon Feb 27, 2017 2:19 am

For "hex state" see the wiki page on joystick usb mapping. Long story short you can map combination of buttons to individual keys.


Social Media

     

Return to “ST(E) Clones (Suska / MiST)”

Who is online

Users browsing this forum: No registered users and 2 guests