RPI/Linux Keymapping

Door insommm

Supporter (2)

afbeelding van insommm

08-01-2014, 21:00

Okay so I have OpenMSX running fine on my raspberry pi thanks to chameleonpi.
Using frogger as a test rom, the standard keyboard number keys 1 and 2 start 1 and 2 player mode in game respectively.
I'm looking to remap these to my own arcade controls I have hooked up as a joypad through a usb interface.

Now after running 'plug joyporta joystick1' in the emulator console, my joystick appears to be working and I've found out how to bind joypad buttons, however i'm a little stuck when it comes to the keymatrix setting and the relating hex values for each key. Which are kind of briefly explained here: http://openmsx.sourceforge.net/manual/user.html#joystick

So the command is bind "joy1 button1 up/down" "keymatrixup/down (rownumber) (hexvalue)"

After a bit of playing around with key bindings i've got this:
bind "joy1 button20 down" "keymatrixdown 0 0x1F"
bind "joy1 button20 up" "keymatrixup 0 0x1F"

It appears that with the bindings above my player 1 start button now works, don't ask me where I got the hex value from, I think it was a lucky guess. Does anyone know how to find out hex values for the other relevant keys. I've looked at the unicodemaps\ folder for clues but cant seem to make heads or tails of it and the link above only briefly glosses over these settings and does not explain how the keymatrix is defined.

Okay so i've just found this image:

That explains the rows, just need to work out what hex values relate to the bits... still none the wiser at the moment.

Appreciate any help!!

Thanks,
Tom

Aangemeld of registreer om reacties te plaatsen

Van insommm

Supporter (2)

afbeelding van insommm

08-01-2014, 22:07

I'm still pretty new to all this so apologies if this is an easy one or I'm missing something blatantly obvious!

Van Manuel

Ascended (18233)

afbeelding van Manuel

10-01-2014, 22:28

http://map.grauw.nl/articles/keymatrix.php explains how the keymatrix works and also tells you what the hex value means :)

Van Grauw

Ascended (10137)

afbeelding van Grauw

11-01-2014, 14:04

Each column in that key matrix table specifies a bit. For example, the UP cursor key corresponds to row 8 with a binary value of 00100000. If you convert this value to hexadecimal, it’s 20 (0010 = 2, 0000 = 0). A quick binary → hexadecimal conversion table:

00000001 = 01
00000010 = 02
00000100 = 04
00001000 = 08
00010000 = 10
00100000 = 20
01000000 = 40
10000000 = 80