Is it possible to map keyboard to controller?

msimplay
Posts: 50
Joined: Tue Jun 16, 2020 6:33 am
Has thanked: 33 times
Been thanked: 2 times

Is it possible to map keyboard to controller?

Unread post by msimplay »

I was wondering if its possible to map keyboard keys to the controller?

Many games use a combination of both keyboard and joystick in computer games.
User avatar
Bunker
Posts: 84
Joined: Sun Jan 02, 2022 10:29 am
Has thanked: 46 times
Been thanked: 10 times

Re: Is it possible to map keyboard to controller?

Unread post by Bunker »

Im not 100% sure but you may be able to do that with this device, its usually for converting Controller to Mouse and keyboard so may be worth looking if you can do the opposite:

https://www.amazon.co.uk/dp/B078J2HQ9D
User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: Is it possible to map keyboard to controller?

Unread post by aberu »

Yes, just go to Define Gamepad in the main MiSTer menu (the menu you get when you first power-on your MiSTer), and press keyboard buttons instead of gamepad buttons. It should work.

Some keyboards occasionally use multiple keycodes per key, so you may have to do this over a few times if you see two buttons press instantly in a row.
birdybro~
Spuddle
Posts: 7
Joined: Thu Jan 20, 2022 7:31 am

Re: Is it possible to map keyboard to controller?

Unread post by Spuddle »

f12 for menu..f12 again, then you'll see menu with define jostick buttons....pressing space on keyboard to skip options you dont need...
I think that's right..for each controller, seperately
akeley
Top Contributor
Posts: 1441
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 496 times
Been thanked: 467 times

Re: Is it possible to map keyboard to controller?

Unread post by akeley »

Define Joystick Buttons is a global choice, so I suppose different keybinds could not work on different cores? The button number is also rather limited, even on more advanced gamepads.

There's a in-core "Button/Key remap for game" option which is quite great, and allows to make changes in particular games. The big downside though is that it is not permanent (and also core-wide). So you need to re-do your keybinds with every cold reboot, and also during game changes.

I've been actually just thinking about making a request for this, so it'd work on permanent basis - most likely with saving individual game configs. It'd be a massive functionality boon for microcomputer games.

CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos

User avatar
neogeo81
Top Contributor
Posts: 445
Joined: Fri Apr 16, 2021 1:52 pm
Has thanked: 34 times
Been thanked: 47 times

Re: Is it possible to map keyboard to controller?

Unread post by neogeo81 »

akeley wrote: Fri Jan 21, 2022 1:45 pm Define Joystick Buttons is a global choice, so I suppose different keybinds could not work on different cores? The button number is also rather limited, even on more advanced gamepads.

There's a in-core "Button/Key remap for game" option which is quite great, and allows to make changes in particular games. The big downside though is that it is not permanent (and also core-wide). So you need to re-do your keybinds with every cold reboot, and also during game changes.

I've been actually just thinking about making a request for this, so it'd work on permanent basis - most likely with saving individual game configs. It'd be a massive functionality boon for microcomputer games.
joystick buttons is a global choice?

You can and have to define the buttons for each core because the autobind doesn't work super well. And those settings stay.

You are refering to the Button/Key remap function. That does not save.
Attachments
20220121_150713.jpg
20220121_150713.jpg (2.33 MiB) Viewed 8298 times
msimplay
Posts: 50
Joined: Tue Jun 16, 2020 6:33 am
Has thanked: 33 times
Been thanked: 2 times

Re: Is it possible to map keyboard to controller?

Unread post by msimplay »

Will test this out on Arabian Nights you have 3 buttons that are troublesome.

Up is jump mapped to controller button
Menu is spacebar mapped to a controller button.
Lastly leave attack as a joystick same as normal mapping.

Will get on with this tonight and see how I get on thanks
akeley
Top Contributor
Posts: 1441
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 496 times
Been thanked: 467 times

Re: Is it possible to map keyboard to controller?

Unread post by akeley »

neogeo81 wrote: Fri Jan 21, 2022 1:59 pm joystick buttons is a global choice?

You can and have to define the buttons for each core because the autobind doesn't work super well. And those settings stay.
This is irrelevant because you can't really map keyboard keys in this menu. If you try it's very hit and miss, and even if it has worked well it'd still have the aforementioned limitations. It's really meant for console and computer controllers, not keyboards.

And that's why permanent per-game configs would be awesome. You could then define the needed keys once with "Button key/remap for game" and it'd always work. Case in point: yesterday I was playing Alone in the Dark on ao486 with Dualshock4. Mapped cursor keys to the analog stick, Enter to Circle, Space to Cross, Esc to Square - works a treat. But now when I reboot the core it's all gone and has to be redone everytime. And even without reboot, I later went on to play Shadow Of The Comet, which requires a different set of keys to operate and I had to remap again.

Another solution is something like Mode buttons in the C64 core - but that's a bit more cumbersome and requires a good memory to remember all the combos.

CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos

msimplay
Posts: 50
Joined: Tue Jun 16, 2020 6:33 am
Has thanked: 33 times
Been thanked: 2 times

Re: Is it possible to map keyboard to controller?

Unread post by msimplay »

I tried to MAP spacebar to Y button on an 8bitdo SN30Pro so that I could use the screen clearing bomb from the controller in "Turrican 2" but was unable to
The MegaAGS Whdload game already maps jump to a button rather than directional pad
ulrikbrick
Posts: 2
Joined: Tue May 26, 2020 8:51 pm

Re: Is it possible to map keyboard to controller?

Unread post by ulrikbrick »

Amazing, thanks for the help. I needed this for 'Thrust' on the C64. So simple to do. First the target button on the controller followed by the key. And then next controller button until they are all done.

Post Reply