Simulating keyboard press with gamepad

Hello all,

I’m using a custom-built arcade game without any keyboard plugged in. The problem is, when using o2em emulator (Videopac / Odyssey 2), the emulator wait for keys “1” or “2” on the keyboard.

Is there a way, in retroarch.cfg, to simulate keyboard strokes with gamepad buttons ?

Thanks a lot,

Xavier.

Answer to myself: as a first solution, I modified the “libretro.c” file in the root directory of e2em git repository, and modified this: key[RETROK_1] = input_state_cb(0, RETRO_DEVICE_KEYBOARD, 0, RETROK_1); key[RETROK_2] = input_state_cb(0, RETRO_DEVICE_KEYBOARD, 0, RETROK_2); with this: key[RETROK_1] = input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START); key[RETROK_2] = input_state_cb(1, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START); It’s ugly but at least it works, I can use START on the first pad to play first mode, and START on the second pad to play second mode.

As a more elegant solution, have you considered a keymapper like xpadder?

I use it to do all sorts of hotkeys.

Like if I hold Right-Stick-Click, and push the dpad around I can pause/play/skip/previous on winamp for music with pre-defined hotkeys.

I also do this for RetroArch in that I can hold Select and push up to save or down to load a state.

Oh that looks great.

I could use it to implement the load/save/whatever functions I couldn’t configure up to now!

Thanks a lot :slight_smile:

Hi,

Latest versions of libretro-o2em (>April 25th 2018) use X,Y,L,R to simulate keystrokes on 1,2,3,4.

Thomas

1 Like

Great news, I can finally stop backporting this patch. Thanks :slight_smile:

Its great to see little improvements to cores. I will have a little play with this tonight.

Side note has anyone ever emulated the original oddessy machine?