|Re: [hatari-devel] Insert button of Inputs dialog (emulation menu of hatariui)|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
On 15.1.2023 21.28, Miguel Saro wrote:
I am interested in the answer to Yves Le Berre on the correspondence between keyboard. In a given language the keyboards ST, STE MegaST, MegaSte, TT and Falcon do not have the same scancode?
ST, STE, and Falcon have builtin keyboard, but for other models the
keyboard is external, so they may have different (e.g. additional)
If I limit myself to Apple and Hatari French keyboards,
Hatari project cares about mapping SDL key events to Atari scancodes.
What SDL key event maps to given host keyboard key, is relevant for SDL
project, not Hatari. I mean, if e.g. SDL does not have SDL_Keycode for
some character produced by the host keyboard, it's SDL issue, not Hatari
> will I have several transcoding tables to do?
If you care only about French Atari keyboard, mapping from SDL_Keycode
(symbolic) values  to Atari keyboard scancodes (key locations) on
that keyboard  would be enough.
Some of the Atari keyboard keys can produce up to 4 different characters
. I.e. there needs to be *four* mapping tables per keyboard language.
 See French layout here: https://tho-otto.de/keyboards/
Le 14 janv. 2023 à 14:43, Eero Tamminen <oak@xxxxxxxxxxxxxx> a écrit :
On 13.1.2023 19.40, Yves Le Berre wrote:
The Insert button of Inputs dialog (emulation menu of Hatari UI)
does not insert correct string ST side.
The dialog box correctly displays the PC string but
when the insert button is pressed, the ST string is
a mix between american and french ST keys (letters capitalized).
That's actually a pretty hard thing to solve.
Hatari UI does not know which language / keymap user has selected in TOS, so it uses remote API scancodes.
I think best way to solve that would be:
1. Creating (C-code) mappings from SDL key symbols to Atari scancodes for keys in all Atari keyboard layouts 
2. Hatari using those mappings to do SDL key symbol -> Atari scancode based on what keyboard layout TOS is using (based on TOS country code & VRAM settings, and which TOS version is in question) 
3. Hatari UI changing to using symbolic keys instead of scancodes
But 1) is a lot of work. And 2) assumes that user does not use some later functionality (MiNT keymaps, some ACC etc) to map keys further.
 That's needed any way for users to be able to input all TOS supported keys from their keyboards, in all TOS supported languages.
While scancode support gives 95-99% of that (depending on language), there are few keys that it cannot cover , and while symbolic key support could handle those, it's currently *very* incomplete, as currently there's *no* per-keymap support.
 There are a lot of Atari keyboard layouts, and they share surprising small number of key locations:
 due to differences between Atari keyboard layout and USB standard SDL uses for the scancodes.
M et Y Saro
Méaudre: 04 76 94 79 32
Seyssinet: 04 76 21 61 02
// locations. vercors. free. fr
// cocoa. pod. free. fr