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

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


 
With my proposed change of per-locale mappings, it would work well out of the box for users whose keyboard matches the TOS locale. For users whose TOS does not match their keyboards, the symbolic mapping would mean the letters of the keys would map semantically (Q=Q) rather than by physical location (the scancode mapping). I do think this would still be a good default, and makes text entry much easier for most cases..

Understood. I can see how your proposed per-locale symbolic mappings could in particular be useful if TOS does not match the user's keyboard locale and I'll be interested to see how it looks.

For now, I'll follow the advice from the other thread and use the symbolic keyboard mapping in order to be able to type the minus key on my keyboard.

Sorry again for raising an issue that was so recently discussed!

Cheers,
Chris



Otherwise the scancode mapping maps a physical location on the user's keyboard to an ST scancode. This is good for those who want customization, or maybe if there's a game with controls where the keyboard layout is more important than the key meaning (e.g. WASD). I don't think it's possible to create a "one size fits all" scancode mapping, so it would be hard to suggest any scancode mapping that would make a good default.

-- Brad Smith


On Thu, Feb 15, 2024 at 3:57 AM Chris Jenkins <cdpjenkins@xxxxxxxxx> wrote:
It turns out that the thread that I couldn't find is "Recent symbolic keyboard mapping change" from August/September 2023.

In that thread, Thomas describes the symbolic mapping as an ugly hack left over from the era of SDL 1.2 and recommends using the scancode mapping, so that's what I'll do. Scancode mapping works ok for me.

Would it be worth deprecating the symbolic mapping and having Hatari default to the scancode mapping?

Cheers,
Chris


On Thu, 15 Feb 2024 at 07:35, Chris Jenkins <cdpjenkins@xxxxxxxxx> wrote:
Many thanks Brad. Where can I find previous discussion of this issue? I didn't find it when I searched last night, and still can't find it now :-(. Is there a thread on this list that I missed, for example? If I can find it then there's no need for this thread.

Cheers,
Chris

On Thu, 15 Feb 2024, 00:24 Brad Smith, <rainwarrior@xxxxxxxxx> wrote:
The real problem is that we need a different symbolic mapping for each locale of TOS.

Last September I proposed that SDLK_MINUS should be mapped to 0x0C, and then the symbolic mapping would be complete and correct for US TOS at least, which is the one layout it is closest to being a perfect match for. Otherwise the symbolic mapping has many poor mappings for every other possible TOS locale.

 However, this change was resisted, with others stating that SLDK_MINUS had to remain 0x35.

I gave an alternative proposition, which I haven't finished implementing, which is to create a set of symbolic mappings, one for each TOS locale, which are selected by the normal TOS locale detection. This way, the host's keys map to SDL symbols, and then the SDL symbols map correctly to the TOS being used.

I have implemented a few languages already, but I haven't finished completing the set yet.

-- Brad Smith


On Wed, Feb 14, 2024 at 4:08 PM Chris Jenkins <cdpjenkins@xxxxxxxxx> wrote:
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




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