[hatari-devel] Minus key is mapped to / in Hatari when using KEYMAP_SYMBOL

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

I noticed that, when using Hatari on my UK Mac with the symbolic keymap, the - (minus) key is mapped to the / (forward slash) character in UK TOS or emutos. This doesn't happen when using the scancode keymap or if I define a keyboard mapping file that explicitly maps the minus key to the standard VDI scancode for minus. It also doesn't happen if I use a German keyboard layout on my Mac.

Looking at the function Keymap_SymbolicToStScanCode in keymap.c, I can see the following:

case SDLK_MINUS: code = 0x35; break;

Looking at at  https://freemint.github.io/tos.hyp/en/scancode.html, 0x35 (decimal 53) is the scancode for the minus key in the German keyboard layout (as well as several other national keyboard layouts) but in the USA layout (and he UK layout, and in the standard VDI scancodes) it is the scancode for the / (forward slash) character.

Given that the comment for Keymap_SymbolicToStScanCode says "This assumes a QWERTY ST keyboard", would it make sense to map SDLK_MINUS to 0x0C (the minus key in UK/USA/standard VDI scancodes)?

The attached patch does this, and fixes the problem for me and my UK Mac keyboard layout. I confess I'm not quite sure what the full implications are, though. Will this break something for users of German (and other) keyboard layouts?

Cheers,
Chris


Attachment: 0001-Map-SDLK_MINUS-to-USA-minus-key.patch
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/