Re: [hatari-devel] Insert button of Inputs dialog (emulation menu of hatariui)

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


Hi,

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) scancodes.


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 one.


> will I have several transcoding tables to do?

If you care only about French Atari keyboard, mapping from SDL_Keycode (symbolic) values [1] to Atari keyboard scancodes (key locations) on that keyboard [2] would be enough.

Some of the Atari keyboard keys can produce up to 4 different characters [2]. I.e. there needs to be *four* mapping tables per keyboard language.


	- Eero

[1] https://wiki.libsdl.org/SDL2/SDL_Keycode

[2] See French layout here: https://tho-otto.de/keyboards/


   - Miguel


Le 14 janv. 2023 à 14:43, Eero Tamminen <oak@xxxxxxxxxxxxxx> a écrit :

Hi,

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]

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) [1]

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.


[1] 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 [3], and while symbolic key support could handle those, it's currently *very* incomplete, as currently there's *no* per-keymap support.

[2] There are a lot of Atari keyboard layouts, and they share surprising small number of key locations:
	https://tho-otto.de/keyboards/


	- Eero

[3] 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





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