On Tue, Feb 20, 2024 at 10:19 AM Yves Le Berre <
yves.le_berre@xxxxxxxxx> wrote:
> Between french standard (105 keys) PC keyboard and french ST keyboard
> there are some keys that cause problems with modifiers :
I do not feel that it is a good idea try to include modifier modulation in this concept. That is not the goal here, and I think attempting to do so will cause more new problems than it would solve. I do not think we should want pressing one key to cause 2 other keys to press or unpress in emulation.
The goal is not to re-engineer the entire modern input method situation, it is only to give one a simple and useful default key-to-key map for each language. An improvement over the current symbolic map which can't satisfy them all with one map. I'm not making Hatari do anything it can't already with the custom scancode mapping, I just want the default setup to be easier to use than it currently is.
Each host key goes to 1 emulated scancode. That's it. It's only a key mapping, not a text output mapping. No more complexity than this. For many things, especially modified keys, there will not be a perfect mapping candidate. We should do the best we can, as consistent and standard as we can, but some decisions are going to be subjective and compromised.
Layouts used as reference:
http://www.kbdlayout.info/kbdfrhttps://tho-otto.de/keyboards/
> '_' is [_] pc side and [SHIFT] + [-] ST side
> '~' is [ALTGR] + [é] pc side and [ALT (or CTRL ?)] + [SHIFT] + [#] ST side
This one is a problem. ST has a '-'/'_' key but the modern French layout does not. Similar story with the '#' key. We should map something to both of these, but I'm not sure which key would be most appropriate.
> '§' is [SHIFT] + [!] pc side and [§] ST side.
'§' is accessible as part of the [6] key on the ST, and the numeric key assignment takes priority here, so I think this is already in the most appropriate mapping.
> '{' is [ALTGR] + ['] pc side and [ALT (or CTRL ?)] + [SHIFT] + [^] ST side,
> '}' is [ALTGR] + [=] pc side and [ALT (or CTRL ?)] + [SHIFT] + [$] ST side,
These are mapped from the host [^] and [$] which are in the same place on the Atari ST keyboard. On the ST keyboard this allows ALT for '(' and ')' and ALT + SHIFT for '{' and '}'. So, these 2 keys I think are the best mapping we can have for them, but it's true that [{}] are not part of these keys on the modern French layout.
> where do the codes 178 and 249 come from in Keymap_SymbolicToStScanCode_FR ?
case 178: code = 0x29; break; /* ² as ` */
case 249: code = 0x28; break; /* ù */
These are the 2 SDL symbolic codes that this keyboard layout produces that don't have a named enumeration.
178 is produced by ² in the top left of the keyboard. It seems ambiguous what to do with this. I had assigned this to ST `/£ because back quote is in that key position in some layouts, but maybe another choice would be better.
249 is produced by ù in the middle row, next to M. This is in the same place and has the same semantics as the ST equivalent, except the ST also has ALT mode to produce '\' on this key.
So, with those notes above, I feel there are only 3 ST keys on this layout which have a true ambiguity problem. They each need an assignment, but the choice will be subjective for each:
0D = - _
29 = `
£
2B = # | @ ~
In my current incomplete implementation 0D and 2B are inaccessible on a French keyboard. What I will suggest is the following:
1. FR ! § to 0D
! and § are on numerics for the ST, so this was redundant. German/Swiss/Swedish/etc. keyboards have -/_ in this location.
2. FR * µ to 2B
It's the nearest key to the ST position on the modern layout. '*' is already accessible via the $ key so it does not need to map to that.
3. FR
² to 29
US keyboards have back quote in this location.
All 3 of these are arbitrary, and I could see argument for swapping which is which, but at least I think the most important thing here is that every ST key is pressable on common versions of the modern equivalent keyboard.
So, what do you think of that mapping? Do you have a better suggestion? Thanks also for reviewing the code and commenting.
-- Brad Smith