Re: [hatari-devel] Enhanced keymap support

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


Hello,

1) Actually, '§' seems to be the only key on french PC keyboard
with SHIFT PC side and NO SHIFT ST side.

But PC keyboard layout for other countries may have such keys
(modifier PC side and NO modifier ST side).

so, could a NO{LSHIFT,RSHIFT,SHIFT,LALT} Guest modifier solve
this case by releasing these keys before pressing down mapped keys ?


2) Here is the trace for '¤' (RALT + '$' PC side) mapped with ALT_XXX|249
after starting hatari and emuCON :

key down: sym=1073742054 scan=230 mod=0x1200 name='Right Alt'
key down: sym=36 scan=48 mod=0x1200 name='$'
key mapping: f9 (keymap)
key map: sym=0x24 to ST-scan=0xf9
key mod(s): ALT_XXX (0x38) + '2' (0x6e) + '4' (0x6a) + '9' (0x69)
key up: sym=36 scan=48 mod=0x1200 name='$'
key mod(s): ALT_XXX (0x38)
  LSHIFT:0 RSHIFT:0 CTRL:0 ALT:0
key up: sym=1073742054 scan=230 mod=0x1000 name='Right Alt'

=> No output in hatari window

and same trace and no output when '¤' keyed again and again...

But as soon as i enter  key 'Left Alt' 2 (two) times, giving this trace :

key down: sym=1073742050 scan=226 mod=0x1100 name='Left Alt'
key mapping: 38 (symbolic)
key map: sym=0x400000e2 to ST-scan=0x38
key up: sym=1073742050 scan=226 mod=0x1000 name='Left Alt'
  LSHIFT:0 RSHIFT:0 CTRL:0 ALT:0
key down: sym=1073742050 scan=226 mod=0x1100 name='Left Alt'
key mapping: 38 (symbolic)
key map: sym=0x400000e2 to ST-scan=0x38
key up: sym=1073742050 scan=226 mod=0x1000 name='Left Alt'
  LSHIFT:0 RSHIFT:0 CTRL:0 ALT:0

=> Then the character appears every time when i enter sucessively '¤' and 'Left Alt'
with the same trace :

key down: sym=1073742054 scan=230 mod=0x1200 name='Right Alt'
key down: sym=36 scan=48 mod=0x1200 name='$'
key mapping: f9 (keymap)
key map: sym=0x24 to ST-scan=0xf9
key mod(s): ALT_XXX (0x38) + '2' (0x6e) + '4' (0x6a) + '9' (0x69)
key up: sym=36 scan=48 mod=0x1200 name='$'
key mod(s): ALT_XXX (0x38)
  LSHIFT:0 RSHIFT:0 CTRL:0 ALT:0
key up: sym=1073742054 scan=230 mod=0x1000 name='Right Alt'
key down: sym=1073742050 scan=226 mod=0x1100 name='Left Alt'
key mapping: 38 (symbolic)
key map: sym=0x400000e2 to ST-scan=0x38
key up: sym=1073742050 scan=226 mod=0x1000 name='Left Alt'
  LSHIFT:0 RSHIFT:0 CTRL:0 ALT:0


3) No other issue detected with the mapping. I repost the mapping configuration
as i changed documentation.

Yves

Le 10/12/2021 à 10:34, Eero Tamminen a écrit :
Hi,

On 8.12.2021 22.16, Yves Le Berre wrote:
In attachment, you'll find the configuration of french PC keyboard mapping.

Thanks, you've documented it nicely!

(I'm considering removing GUI, ALT & CTRL combo PC mod ones though, as shortcuts for pressing both left *and* right one are pretty much useless, whereas SHIFT shortcut for *either* left or right one is very useful.)


Hatari was compiled with patches from M. Tamminen.

It was spawned without any argument (no --language, nor --layout)
and the default configuration uses emutos 1.1.1 (512K rom french language)
and falcon with 14 Mbytes memory.

I tested this keyboard configuration with emuCON (File menu emutos)

All the mapping give the good result except :

1)
0x38|SHIFT,0x07
gives a '6' ST side when keying '§' PC side.

You already have SHIFT key down, so TOS gives you the shifted '§', which on the French KBD is '6'.

(This is the only mapping you had, where ST key is missing ST-supported modifier specified for PC.)


I'd rather generate key mapping error when ST side is missing ST modifier(s) specified for PC side.

But I guess I could try temporarily injecting IKBD key release for the already pressed ST modifier, and press it again afterwards.

That would need to be done both for press & release, and the extra modifiers state changes on the ST side could mess some ST apps / games KBD state handling, so I'm a bit hesitant about it.

(I think this is something that Vincent's patch could not handle.)


This one may be corrected with :
0x38|SHIFT,ALT_XXX|221
but this disables auto repeat

I don't think Hatari can do anything to get ALT_XXX shortcuts repeating.


2)
0x30|RALT,ALT_XXX|249
gives no character ST side when keying '¤' PC side
and blocks next keys until alt is keyed PC side
giving the desired ST character (249/0xf9 in atari character table)

Any idea ?

"gives no character" & "blocks next keys" indicates that it's issue with your host windowing / input system.  It may be handling that key combo as so called "dead key" i.e. eating / mutating some of the involved key press or release events.

You might see this happening in "--trace keymap" output.

But if SDL cannot map all the related key press & release event, Hatari cannot do anything about that.  You just need to map some other key for that character.


Btw. Are above two items *only* issues you've noticed with the new key mapping code?

(If yes, things look pretty good.)


    - Eero

#
# Hatari Key mapping for french pc keyboard
# (Patches for enhanced keymap from M. Eero Tamminen).
#
# Format :: Host (PC) key definition , Guest (ST) key definition
#
# Key definition :: scancode | modifiers
# or (host only) :: keyname  | modifiers
#
# Host key definition is separated from guest key  definition by a comma.
# scancode/keyname and modifiers (several possible) are separated by '|'
# and may be interverted.
#
# Scancode is decimal or hexa (prefixed with 0x)
#
# Host modifiers are  : LSHIFT (left shift),
#                       RSHIFT (right shift),
#                       SHIFT (LSHIFT or RSHIFT),
#                       LCTRL (left control),
#                       RCTRL (right control),
#                       CTRL (LCTRL and RCTRL),
#                       LALT (left alt),
#                       RALT (right alt / alt gr),
#                       ALT (LALT and RALT),
#                       LGUI (left windows),
#                       RGUI (right windows),
#                       GUI (LGUI and RGUI),
#                       CAPS (cap lock),
#                       MODE (menu),
#                       NUM (num lock).
#
# Guest modifiers are : CONTROL,
#                       LSHIFT,
#                       RSHIFT,
#                       ALT,
#                       ALT_XXX.
#
# ALT_XXX is a special case where ST scancode is the decimal code
# (32 to 255) in atari character table.
#
# Keys are mapped in PC SDL scancode order.

# q
0x04,0x1e

# €
0x08|RALT,ALT_XXX|238

# , ?
0x10|SHIFT,0x32|LSHIFT
0x10,0x32

# a
0x14,0x10

# z
0x1a,0x11

# w
0x1d,0x2c

# & 1
0x1e,0x02

# é 2 ~
0x1f|RALT,0x2b|ALT|LSHIFT
0x1f|CAPS,ALT_XXX|144

# " 3 #
0x20|RALT,0x2b
0x20,0x04

# ' 4 {
0x21|RALT,0x1a|ALT|LSHIFT
0x21,0x05

# ( 5 [
0x22|RALT,0x1a|ALT
0x22,0x06

# - 6 |
0x23|RALT,0x2b|LSHIFT
0x23|SHIFT,0x07|LSHIFT
0x23,0x0d

# è 7 `
0x24|RALT,0x29

# _ 8 \
0x25|RALT,0x28|ALT
0x25|SHIFT,0x09|LSHIFT
0x25,0x0d|LSHIFT

# ç 9 ^ (alone, not for accentuated vowel)
0x26|RALT,ALT_XXX|94

# à 0 @
0x27|RALT,0x2b|ALT

# ) ° ]
0x2d|RALT,0x1b|ALT
0x2d|SHIFT,0x0c|LSHIFT

# = + }
0x2e|RALT,0x1b|ALT|LSHIFT
0x2e|SHIFT,0x35|LSHIFT
0x2e,0x35

# ^ " (followed by vowel => vowel with this accent, followed by space or same accent => accent alone)
0x2f|SHIFT,0x1a|LSHIFT
0x2f,0x1a

# $ £ ¤
0x30|RALT,ALT_XXX|249
0x30|SHIFT,0x29|LSHIFT
0x30,0x1b

# * µ
0x31|SHIFT,ALT_XXX|230
0x31,0x1b|LSHIFT

# m
0x33,0x27

# ù %
0x34|SHIFT,0x28|LSHIFT
0x34,0x28

# ² ~
0x35|SHIFT,0x2b|ALT|LSHIFT
0x35,ALT_XXX|253

# ; .
0x36|SHIFT,0x33|LSHIFT
0x36,0x33

# : /
0x37|SHIFT,0x34|LSHIFT
0x37,0x34

# ! §
#0x38|SHIFT,0x07
0x38|SHIFT,ALT_XXX|221
0x38,0x09

# < >
0x64|SHIFT,0x60|LSHIFT
0x64,0x60

############################################################################


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