Re: [hatari-devel] Enhanced keymap support

[ Thread Index | Date Index | More Archives ]

Hi Eero,

I found some time this afternoon so I'm trying to have a look at it.

First thing is that decimal stuff is a pain. The links you provide have the scancodes in hexa, I still don't understand why the heck you demand decimals in the config file ?

Also I don't like using symbols (e.g.) "Q" or stuff like that on the left. It means I have to care about US keyboard layout. But if I want to create a keymap, it's because I have another type of keyboard, so why should I give a shit about US keyboards ? That doesn't make any sense. I'd rather have something consistent, i.e map scancodes to scancodes without some other country's keyboard being there like hair in my soup :D

For example, for 'ù' I must determine that this key is actually ";" on a US keyboard. So I'm mapping ";" not "ù". On my keyboard ";" is another key. How confusing is that ?

To sum up my issues with the usability of this:

* on the left side of the mapping I have use country's keyboard layout as indirection.

* on the right hand side I have to do hexa do decimal conversion as I can't use verbatim the info I find on the link we provide.

-> It feels we're trying to scare people away from using the feature. Try create a full map and you will feel the pain :/

I didn't get the AltGr to work. In the source code, I saw there is KMOD_ALT as meaning either "KMOD_LALT" and/or "KMOD_RALT". But on a normal keyboard, LALT is ALT and RALT is AltGr. These really don't have the same function/meaning, I don't think it's correct to bundle them under ALT. That is very misleading.

Here's the map I tried (I had to look at a US keyboard layout and do hexa to decimal conversion, so plenty of room for errors).

# Q -> A
# W -> Z
# Z -> E
# #
# {

A,Z,E worked, # and { didn't.

I was not able to create a mapping for '[' to something. How do you name these keys ? (side note: using scancode would make things simpler). I didn't try the ALT_xxx or other things (CTRL, accents etc.) because this US keyboard indirection confused me and pissed me off.

I think I'll stick to my patch, the parsing sure isn't as good as yours but it was tons easier for me to create a working map.

Kind regards


Le 19/11/2021 à 18:55, Eero Tamminen a écrit :
Hi Vincent,

Would you have time to test this?

It should fix your issues with the previous versions.

(All numbers are now decimal, for compatibility with earlier Hatari keymap files.)

    - Eero

On 11.11.2021 1.50, Eero Tamminen wrote:
Attached is new version of the patch series, with
following changes:

* Fix: KeysDown[] cleared on reset
* Fix: KeysDown[scancode] cleared on mapping
* Same SDL scancode can have multiple mappings
* Special handling for SHIFT, so that one does
   not need two mappings unless one really wants
   separate mappings for left & right SHIFT
* "KMOD_" prefixes dropped from SDL modifier names
* dec -> hex conversion patch dropped

Attached is also keymap file containing examples
of the mappings with documentation.

SDL scancode names used in mapping file need to
match case of their SDL names.  To help with that,
I've added "listkeys" program back to Hatari.

Modifier names need to be specified as upper case.
That way they're easier to differentiate from SDL
scancode names which are CamelCase.

Vincent, could you give it a try?

Thomas, would you have time to check the commits?

     - Eero

PS. in the mapping file, I'm using "CTRL" for SDL
modifier name, but "CONTROL" for Atari modifier

* SDL mod name comes from SDL KMOD_CTRL define
   and SDL's own name for the key:

* Atari mod name comes from the name of the key
   on the actual Atari keyboard:

Mail converted by MHonArc 2.6.19+