Re: [hatari-devel] Enhanced keymap support

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


Hello,

You'll find in attachment the file «keymap_fr_pc.cfg».
Some mappings were added and comments give more explanations.

Yves

Le 02/02/2022 à 18:51, Yves Le Berre a écrit :
Hello,

My precedent patch was incorrect.
it tried to separate pc mods right and left for (SHIFT, CTRL, ALT, GUI)
but mappings do not give all expected results. For instance :

# '=' []       ===       '+' [SHIFT]      ===      '}' [RALT]
# 'π' [CTRL]   ===       '∞' [SHIFT + CTRL]
0x2e|SHIFT|CTRL,ALT_XXX|223
0x2e|RALT,0x1b|ALT|LSHIFT
0x2e|CTRL,ALT_XXX|227
0x2e|SHIFT,0x35|LSHIFT
0x2e,0x35

when you key symbol '=' with no modifier, you get '=' : OK,
when you key symbol '=' with modifier LSHIFT or RSHIFT, you get '+' : OK,
when you key symbol '=' with modifier RALT, you get '}' : OK,
when you key symbol '=' with modifier LCTRL, you get 'π' : OK,
when you key symbol '=' with modifier RCTRL, you get 'π' : OK,
when you key symbol '=' with modifiers LCTRL and LSHIFT, you get '∞' : OK, when you key symbol '=' with modifiers RCTRL and RSHIFT, you get '∞' : OK,

But

when you key symbol '=' with modifiers LCTRL and RSHIFT, you get 'π' : KO. when you key symbol '=' with modifiers RCTRL and LSHIFT, you get 'π' : KO.

So, to enable multiple modifiers without distinguishing if left or right
modifier was used (as in preceeding configuration example),
i changed the last patch of the serie : 0013-Remap-mod-left-or-right.patch to
0013-Remap-mod.patch. Results are those expected.
All the patches of the serie are filed in enhanced_keymap_patches.tar.gz (cf. attachment)
and must be applied to master.

Yves

#-------------------------------------------------------------------------------
# Hatari Key mapping for French PC Keyboard layout (105 keys) with french TOS.
#
# Following patches must be applied to master :
#
# 0001-Keymap_LoadRemapFile-refactor-rewrite.patch
# 0002-Switch-to-using-KeyMapping-struct-and-KeysDown-array.patch
# 0003-Clear-KeysDown-key-mapping-state-on-reset.patch
# 0004-Add-defines-for-some-of-the-ST-scancode-values.patch
# 0005-Support-for-specifying-ST-key-modifiers-in-the-mappi.patch
# 0006-Add-ALT-XXX-sequence-insert-support-for-keymaps.patch
# 0007-Add-trace-output-for-ST-key-modifiers.patch
# 0008-Support-for-specifying-PC-SDL-key-modifiers-in-the-m.patch
# 0009-Keymap-accept-also-0x-prefixed-hex-values-for-scanco.patch
# 0010-Fix-improve-keymap-file-SDL-key-name-parsing.patch
# 0011-Fix-ALT_XXX-scancode-handling.patch
# 0012-Fix-Single-Mod-Host-Parsing.patch
# 0013-Remap-mod.patch
#
# These patches are filed in enhanced_keymap_patches.tar.gz
# which has been posted to Hatari-devel@xxxxxxxxxxxxxxxxxxx
# on 02/02/2022.
#-------------------------------------------------------------------------------
# Mapping 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 or keyname and modifiers (several possible) are separated by a
# pipe '|' 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 or RCTRL),
#                       LALT (Left Alt),
#                       RALT (Right Alt / Alt gr),
#                       ALT (LALT or RALT),
#                       LGUI (Left Windows),
#                       RGUI (Right Windows),
#                       GUI (LGUI or RGUI),
#                       CAPS (Caps 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.
#
# Empty lines are ignored.
# lines beginning with a hash '#' or semicolon ';' (comments) are ignored.
#-------------------------------------------------------------------------------
# Keys are mapped in Host scancode order. If a SAME Host scancode
# is mapped multiple times, the associated modifiers must be ordered.
#
# For instance, a PC host scancode with three possible modifiers
# mod1, mod2, mod3 must be configured (Host key definition) like this :
#
# scancode|mod1|mod2|mod3     (1)
# scancode|mod1|mod2          (2)
# scancode|mod1|mod3          (2)
# scancode|mod2|mod3          (2)
# scancode|mod1               (3)
# scancode|mod2               (3)
# scancode|mod3               (3)
# scancode
#
# Line marked (1) (3 modifiers) must be first,
# Then lines marked (2) (2 modifiers) in any order,
# Then lines marked (3) (1 modifier) in any order,
# Then line marked (4) (no modifier) must be last.
#
# This is because Hatari search the first definition where :
# input scancode = entry scancode
# and
# input mods and entry mods = entry mods.
#
# If entries are given in this order :
#
# scancode|mod1               (1)
# scancode|mod1|mod2          (2)
# scancode                    (3)
#
# and input is scancode + mod1 + mod2
# the entry used by Hatari will be (1) because
# input scancode = entry scancode
# and
# (mod1 and mod2) and mod1 = mod1.
#
# The worst order would be to place scancode without modifier entry
# before same scancode with any modifier entry because
# any modifier and no modifier = no modifier.
# The user could no longer use any modifier key for this scancode.
#-------------------------------------------------------------------------------
# Comments before mappings show guest symbol obtained
# when key for host symbol and given modifiers are entered.
#-------------------------------------------------------------------------------
# REMEMBER : 
#
# 1) Any host scancode or keyname not mapped here defaults to
#    symbolic keyboard mapping (corresponding to TOS language)
#
# 2) Hatari uses shortcuts to specific functions in keyboard
#    setup and number of these shortcuts use RALT modifier.
#    So, you must remap the key used by Hatari if you want use
#    it in your mappings.
#
#    Example : Hatari maps 'g' + [RALT] to 'take screenshot' shortcut.
#    If you want to use 'g' + [RALT] in your mappings, you must map
#    another key than 'g' to 'take screenshot' shortcut.
#
# 3) Mappings defined here have been tested with a french PC keyboard
#    (105 keys) and french TOS. They all produce expected characters
#    (and display expected symbols) on Hatari screen.
#-------------------------------------------------------------------------------

# 'q'                     =>     'q'
# 0x04 ou 4 ou q
0x04,0x1e

# 'c' + [LALT]            =>     '©'
# 0x06 ou 6 ou c
0x06|LALT,ALT_XXX|189

# 'e' + [RALT]            =>     '€'
# 0x08 ou 8 ou e
0x08|RALT,ALT_XXX|238

# 'i' + [SHIFT] + [LALT]  =>     '∞'
# 'i' + [LALT]            =>     'π'
# 0x0c ou 12 ou i
0x0c|SHIFT|LALT,ALT_XXX|223
0x0c|LALT,ALT_XXX|227

# ',' + [SHIFT]           =>     '?'
# ','                     =>     ','
# 0x10 ou 16
0x10|SHIFT,0x32|LSHIFT
0x10,0x32

# 'o' + [SHIFT] + [LALT]  =>     'Œ'
# 'o' + [SHIFT] + [CTRL]  =>     'Ø'
# 'o' + [LALT]            =>     'œ'
# 'o' + [CTRL]            =>     'ø'
# 0x12 ou 18 ou o
0x12|SHIFT|LALT,ALT_XXX|181
0x12|SHIFT|CTRL,ALT_XXX|178
0x12|LALT,ALT_XXX|180
0x12|CTRL,ALT_XXX|179

# 'a' + [SHIFT] + [LALT]  =>     'Æ'
# 'a' + [SHIFT] + [CTRL]  =>     'Å'
# 'a' + [LALT]            =>     'æ'
# 'a' + [CTRL]            =>     'å'
# 'a'                     =>     'a'
# 0x14 ou 20 ou a
0x14|SHIFT|LALT,ALT_XXX|146
0x14|SHIFT|CTRL,ALT_XXX|143
0x14|LALT,ALT_XXX|145
0x14|CTRL,ALT_XXX|134
0x14,0x10

# 'r' + [LALT]            =>     '®'
# 0x15 ou 21 ou r
0x15|LALT,ALT_XXX|190

# 's' + [LALT]            =>     'ß'
# 0x16 ou 22 ou s
0x16|LALT,ALT_XXX|158

# 't' + [LALT]            =>     '™'
# 0x17 ou 23 ou t
0x17|LALT,ALT_XXX|191

# 'z'                     =>     'z'
# 0x1a ou 26 ou z
0x1a,0x11

# 'w'                     =>     'w'
# 0x1d ou 29 ou w
0x1d,0x2c

# '&' + [SHIFT] + [RALT]  =>     '¼'
# '&' + [RALT]            =>     '½'
# 0x1e ou 30
0x1e|SHIFT|RALT,ALT_XXX|172
0x1e|RALT,ALT_XXX|171

# 'é' + [CAPS]            =>     'É'
# 'é' + [RALT]            =>     '~'
# 0x1f ou 31
0x1f|CAPS,ALT_XXX|144
0x1f|RALT,0x2b|LSHIFT|ALT

# ["] + [RALT]            =>     '#'
# 0x20 ou 32
0x20|RALT,0x2b

# ['] + [RALT]            =>     '{'
# 0x21 ou 33
0x21|RALT,0x1a|LSHIFT|ALT

# '(' + [RALT]            =>     '['
# 0x22 ou 34
0x22|RALT,0x1a|ALT

# '-' + [RALT]            =>     '|'
# '-' + [SHIFT]           =>     '6'
# '-'                     =>     '-'
# 0x23 ou 35
0x23|RALT,0x2b|LSHIFT
0x23|SHIFT,0x07|LSHIFT
0x23,0x0d

# 'è' + [RALT]            =>     '`'
# 0x24 ou 36
0x24|RALT,0x29

# '_' + [RALT]            =>     '\'
# '_' + [SHIFT]           =>     '8'
# '_'                     =>     '_'
# 0x25 ou 37
0x25|RALT,0x28|ALT
0x25|SHIFT,0x09|LSHIFT
0x25,0x0d|LSHIFT

# 'ç' + [RALT]            =>     '^'
# 0x26 ou 38
0x26|RALT,ALT_XXX|94

# 'à' + [RALT]            =>     '@'
# 0x27 ou 39
0x27|RALT,0x2b|ALT

# ')' + [RALT]            =>     ']'
# ')' + [SHIFT]           =>     '°'
# 0x2d ou 45
0x2d|RALT,0x1b|ALT
0x2d|SHIFT,0x0c|LSHIFT

# '=' + [SHIFT] + [RALT]  =>     '±'
# '=' + [RALT]            =>     '}'
# '=' + [SHIFT]           =>     '+'
# '='                     =>     '='
# 0x2e ou 46
0x2e|SHIFT|RALT,ALT_XXX|241
0x2e|RALT,0x1b|LSHIFT|ALT
0x2e|SHIFT,0x35|LSHIFT
0x2e,0x35

# followed by vowel => vowel with this accent,
# followed by space or same accent => accent alone.
# '^' + [SHIFT]           =>     '¨'
# '^'                     =>     '^'
# 0x2f ou 47
0x2f|SHIFT,0x1a|LSHIFT
0x2f,0x1a

# '$' + [SHIFT] + [RALT]  =>     '¶'
# '$' + [RALT]            =>     '¤'
# '$' + [SHIFT]           =>     '£'
# '$'                     =>     '$'
# 0x30 ou 48
0x30|SHIFT|RALT,ALT_XXX|188
0x30|RALT,ALT_XXX|249
0x30|SHIFT,0x29|LSHIFT
0x30,0x1b

# '*' + [RALT]            =>     '÷'
# '*' + [SHIFT]           =>     'µ'
# '*'                     =>     '*'
# 0x31 ou 49
0x31|RALT,ALT_XXX|246
0x31|SHIFT,ALT_XXX|230
0x31,0x1b|LSHIFT

# 'm'                     =>     'm'
# 0x33 ou 51 ou m
0x33,0x27

# 'ù' + [SHIFT]           =>     '%'
# 'ù'                     =>     'ù'
# 0x34 ou 52
0x34|SHIFT,0x28|LSHIFT
0x34,0x28

# '²' + [RALT]            =>     '~'
# '²' + [SHIFT]           =>     '³'
# '²'                     =>     '²'
# 0x35 ou 53
0x35|RALT,0x2b|LSHIFT|ALT
0x35|SHIFT,ALT_XXX|254
0x35,ALT_XXX|253

# ';' + [SHIFT]           =>     '.'
# ';'                     =>     ';'
# 0x36 ou 54
0x36|SHIFT,0x33|LSHIFT
0x36,0x33

# ':' + [SHIFT]           =>     '/'
# ':'                     =>     ':'
# 0x37 ou 55
0x37|SHIFT,0x34|LSHIFT
0x37,0x34

# '!' + [SHIFT]           =>     '§'
# '!'                     =>     '!'
# 0x38 ou 56
0x38|SHIFT,ALT_XXX|221
0x38,0x09

# '<' + [SHIFT] + [ALT]   =>     '≥'
# '<' + [SHIFT] + [CTRL]  =>     '»'
# '<' + [ALT]             =>     '≤'
# '<' + [CTRL]            =>     '«'
# '<' + [SHIFT]           =>     '>'
# '<'                     =>     '<'
# 0x64 ou 100
0x64|SHIFT|ALT,ALT_XXX|242
0x64|SHIFT|CTRL,ALT_XXX|175
0x64|ALT,ALT_XXX|243
0x64|CTRL,ALT_XXX|174
0x64|SHIFT,0x60|LSHIFT
0x64,0x60
#-------------------------------------------------------------------------------


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