[hatari-devel] Keyboard layout and two small bugs (was: Two problems)

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

Thorsten Otto schrieb:

> Apropos keyboard layout: there is one conceptional problem with that mapping. 
> Hatari currently only allows to map one key to another. The problem with this 
> is that, on eg. german keyboards, there are some ascii characters physically 
> located on different keys on a pc keyboard compared to an Atari keyboard. For 
> example the left bracket is located on AltGr+8 on a pc keyboard, but Alt-ö on 
> an Atari. That means, theoretically, hatari should produce scancode 39 when 
> pressing ö, and also when pressing AltGr+8, because that is what TOS would 
> expect (assuming i use a german TOS version). OTOH, pressing 8 alone (or with 
> shift) should produce scancode 9, because the mapping of that key is 
> identical.

Please let's *not* go down this route with Hatari! Needing to map PC key
combinations to (different) Atari key combininations massively increases
code complexity and hence the potential for bugs and the amount of
testing required. Be aware that you have to consider N * M cases then.
What if someone with a German keyboard wants to run US TOS? Or French
keyboard, German TOS? Etc.

Also this opens up new compatibility issues. Let me give you an example:
Let's suppose you want to type a tilde ("~"), which is AltGr and "+" on
a German PC keyboard but a separate key on the Atari keyboard.

So you press AltGr (right Alt). Hatari of course cannot know of your
intention of wanting to type ~, so it'll send the scancode for "pressing
Alt" to the emulated Atari. TOS will therefore now register the Alt
modified as pressed. Now you press the "+" key. Now Hatari first has to
fake a "releasing Alt" scancode for TOS before sending the scancode of
the "~" key on the Atari keyboard. Now, let's assume some crazy Atari
program uses a shortcut of Alt and "~". How do you type that with your
proposed mapping scheme?

> That problem currently prevents me from producing those characters in most 
> cases. 

Why does it *prevent* you typing characters like brackets in Hatari?
Simply use Alt+ö and so on, like you would do an Atari keyboard. It
works fine.

I only have two small issues with the keyboard mapping (German PC
keyboard [1], German TOS with German Atari keyboard [2] table), which I
think are genuine bugs in Hatari.
On the one hand with the symbolic keyboard mapping, the key that
produces "´" and "`" is dead. I think it should map to the corresponding
key on the Atari keyboard.
On the other hand, with the scancode mapping, while the key mentioned
above works, both the "<"/">" key and the "#"/"'" key on the PC keyboard
produce "<"/">" on the Atari. There is no key on the PC keyboard that is
mapped to "#"/"^" on the Atari. This is indeed the only case where one
is actually prevented typing a character like Thorsten complained above.
This is particularly annoying when coding C. The "#"/"'" on the keyboard
should be mapped to "#"/"^".

This is with Hatari 2.1 and Windows 10.


[1] <https://en.wikipedia.org/wiki/QWERTZ#/media/File:KB_Germany.svg>
Christian Zietz  -  CHZ-Soft  -  czietz@xxxxxxx
WWW: http://www.chzsoft.de/
PGP/GnuPG-Key-ID: 0x52CB97F66DA025CA / 0x6DA025CA

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