Re: [hatari-users] Key mapping issues

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


Hi,

On 1/11/19 1:21 AM, Charles Curley wrote:
On Fri, 4 Jan 2019 21:49:39 +0200
Eero Tamminen <oak@xxxxxxxxxxxxxx> wrote:
On 1/3/19 11:10 PM, Charles Curley wrote:
I have an odd key mapping problem. Hatari, as of Sun Dec 16 13:31:19
2018 +0200, hg commit 7269:7e5cd2b03ab7. Debian 9.x as
updated. Keyboard is a Logitech USB keyboard. evemu-describe does
not return any identifiers.

Hatari appears to be swapping the `/~ key with the \/| key. That is
to get | I have to press ~. That's a bit of a problem.

Different TOS versions map Atari scancodes to different keys, and
individual Atari programs can also install their own key mapping
tables too.

As to Hatari side, there are 2 different methods for providing Atari
keyboard scancodes to emulation, one based on libSDL key scancodes,
and one based on libSDL key symbols.
>
Have you tried both?  And a TOS version which key mapping is closest
to what you want?

I have tried both. And both are unsatisfactory for one reason or
another. I am currently using Scancode keyboard mapping, with which I
get the above problem.

emutos is etos256us.00.09.10.img, version 0.9.10.


If you need to experiment, I'd recommend EmuTOS:
https://sourceforge.net/projects/emutos/files/emutos/0.9.10/emutos-256k-0.9.10.zip/download


So I created a scancode file:

`,29
~,29
\,2b
|,2b

Hatari interprets the values as decimal, not hexadecimal.  They're
read with atoi(), so trailing non-numeric letters aren't interpreted.


The 2b codes work correctly, and | shows up on the | key.

That's weird, that maps it to scancode 2, i.e. Atari key "1"?


However,
the ~ key now acts like it's the insert key, and returns 0 and hex
52 ('R'). Not good.

I think scancode 29 is actually Control key.


It's better to start keymap by mapping keys which can
be definitely triggered, e.g:
a,29
b,2

And then testing with e.g. text editor that you got what you
intended.

If not, then checking with keytest.prg what you got.


Any ideas on how to improve this?

Hatari includes tools to investigate what SDL and Atari scancodes
you actually get:
https://hg.tuxfamily.org/hatari/hatari/file/tip/tests/keymap

checkkeys reports that both keys are returning the correct ASCII codes.

listkeys did nothing useful:

charles@hawk:~/versioned/hatari/tests/keymap$ ./listkeys
Sorry, SDL2 doesn't support iterating over all keys.
charles@hawk:~/versioned/hatari/tests/keymap$

I did install and use keytest.prg.  It reports that the two keys are
returning the swapped scancodes.

If you used the above listed values (hex instead of decimals),
are you sure Hatari really used them?


Atari scancode positions on a keyboard are shown in this image:
	http://eerott.mbnet.fi/hatari/img/st-keymap.png

Thanks. I had to dig out an actual 520 ST to map the characters to the
scan codes. | is 43 (to the right of Return), and ` is 41, above the
return key.

Then you should have used:
`,41
~,41
\,43
|,43

If that doesn't work, are those keys handled like "dead keys"
(you need to press multiple keys to get single X key symbol)?

If yes, dead keys aren't supported by symbolic key mapping,
which is implied by keyboard mapping file usage.


	- Eero



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