Re: [hatari-devel] Enhanced keymap support

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


Hello,

You can find in attachment new version of enhanced_keymap_patches.tar.gz
which has been modified (0003-Clear-KeysDown-key-mapping-state-on-reset.patch)
due to last changes in reset.c for re-setting natfeat SCSI subsystem.

As usual, patches need to be applied to master before build.

Yves


Le 01/09/2023 à 14:34, Yves Le Berre a écrit :
Hello,

Following last keymap.c patches (applied on 2023-08-27) and in
case anyone still wants to use enhanced keymap patches serie,
I rebased it, renumbered useful and suppressed useless patches.

Serie is now :

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
0014-Add-NO-XXX-mod.patch
0015-Replace-strlcpy.patch

These patches are filed in enhanced_keymap_patches.tar.gz (attachment)
and need to be applied to master before building Hatari.

A configuration file : keymap_fr_pc.cfg (found in attachment)
explains the format of the configuration file and gives an example
of Hatari key mapping for french PC keyboard layout (105 keys)

Yves

Attachment: enhanced_keymap_patches.tar.gz
Description: application/gzip

#-------------------------------------------------------------------------------
# Hatari Key mapping for French PC Keyboard layout (105 keys)
#
# Following patches must be applied to master in this order :
#
# 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
# 0014-Add-NO-XXX-mod.patch
# 0015-Replace-strlcpy.patch
#
# These patches are filed in enhanced_keymap_patchs.tar.gz
#-------------------------------------------------------------------------------
# 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,
#                       NO_CONTROL,
#                       NO_LSHIFT,
#                       NO_RSHIFT,
#                       NO_ALT.
#
# ALT_XXX is a special case where ST scancode is the decimal code
# (32 to 255) in atari character table.
# ALT_XXX cannot be set with another ST modifier.
# If the value given as scancode with ALT_XXX mod is [32 to 99],
# you MUST NOT put a leading zero in the value as hatari enhanced
# keymap patches can use strtol with zero base where leading zero
# in string means octal value (see mapping with ALT_XXX|94).
#-------------------------------------------------------------------------------
# lines beginning with a hash '#' or semicolon ';' (comments) are ignored.
# Empty lines 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                    (4)
#
# 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 entry 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
# input mods and entry mods = entry mods.
# i-e : (mod1 + 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.
#-------------------------------------------------------------------------------
# REMEMBER : 
#
# 1) If Host modifiers are set, there is no need to set corresponding
#    ST modifiers, but to show the right ST Key definition, ST modifiers
#    are set in mappings EVEN if corresponding Host modifiers are set.
#    This does not apply to
#    - ALT_XXX which cannot be set with another ST modifier,
#    - NO_XXX which must be set to disable corresponding Host modifier.
#
#    Example :
#
#    [_] + [SHIFT]           =>     [8]
#    0x25|SHIFT,0x09|LSHIFT|RSHIFT
#
#    LSHIFT and RSHIFT ST modifiers are set but not needed ST side as
#    SHIFT is already set Host side.
#
# 2) NO_XXX ST modifiers disable corresponding ST modifiers.
#    NO_LSHIFT disables LSHIFT,
#    NO_RSHIFT disables RSHIFT,
#    NO_CONTROL disables CONTROL,
#    NO_ALT disables ALT.
#
#    Examples :
#
#    a) Allow a key with modifier PC side to map a key without
#       same modifier ST side :
#
#    [!] + [SHIFT]           =>     [§]
#    0x38|SHIFT,0x07|NO_LSHIFT|NO_RSHIFT
#
#    b) Disallow a key with modifier PC side to map a key with
#       same modifier ST side :
#
#    [ù] + [LALT]            =>     [ù]
#    [ù] + [SHIFT]           =>     [%]
#    [ù]                     =>     [ù]
#    0x2f|SHIFT,0x1a|LSHIFT|RSHIFT|NO_ALT
#    0x2f,0x1a|NO_ALT
#
#    instead of
#
#    [ù] + [LALT]            =>     '\'
#    [ù] + [SHIFT]           =>     [%]
#    [ù]                     =>     [ù]
#    0x2f|SHIFT,0x1a|LSHIFT|RSHIFT
#    0x2f,0x1a
#
# 3) Guest key definitions using ALT_XXX disable auto-repeat.
#
# 4) 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 mapping, you must map
#    another key than [g] to 'take screenshot' shortcut.
# 
# 5) Any host scancode or keyname not mapped here defaults to
#    symbolic keyboard mapping (corresponding to TOS rom)
#
# 6) Mappings have been tested with a french PC keyboard (105 keys)
#    and with localized French and USA TOS roms as well as 1024K EmuTOS.
#    They all produce expected characters (and display expected symbols)
#    on Hatari screen.
#-------------------------------------------------------------------------------
# Comments before mappings show guest symbol obtained when key and
# given modifiers for host symbol (french keyboard) are entered.
#-------------------------------------------------------------------------------

# [q]                     =>     [q]
# 0x04 or 4 or q
0x04,0x1e

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

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

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

# [,] + [SHIFT]           =>     [?]
# [,]                     =>     [,]
# 0x10 or 16
0x10|SHIFT,0x32|LSHIFT|RSHIFT
0x10,0x32

# [o] + [SHIFT] + [LALT]  =>     [Œ]
# [o] + [SHIFT] + [CTRL]  =>     [Ø]
# [o] + [LALT]            =>     [œ]
# [o] + [CTRL]            =>     [ø]
# 0x12 or 18 or 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 or 20 or 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 or 21 or r
0x15|LALT,ALT_XXX|190

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

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

# [z]                     =>     [z]
# 0x1a or 26 or z
0x1a,0x11

# [w]                     =>     [w]
# 0x1d or 29 or w
0x1d,0x2c

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

# [é] + [SHIFT] + [RALT]  =>     [É]
# [é] + [RALT]            =>     [~]
# 0x1f or 31
0x1f|SHIFT|RALT,ALT_XXX|144
0x1f|RALT,0x2b|LSHIFT|RSHIFT|ALT

# ["] + [RALT]            =>     [#]
# 0x20 or 32
0x20|RALT,0x2b|NO_LSHIFT|NO_RSHIFT|NO_ALT

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

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

# [-] + [RALT]            =>     [|]
# [-] + [SHIFT]           =>     [6]
# [-]                     =>     [-]
# 0x23 or 35
0x23|RALT,0x2b|LSHIFT|RSHIFT|NO_ALT
0x23|SHIFT,0x07|LSHIFT|RSHIFT
0x23,0x0d

# [è] + [RALT]            =>     [`]
# 0x24 or 36
0x24|RALT,0x29|NO_LSHIFT|NO_RSHIFT|ALT

# [_] + [RALT]            =>     [\]
# [_] + [SHIFT]           =>     [8]
# [_]                     =>     [_]
# 0x25 or 37
0x25|RALT,0x28|NO_LSHIFT|NO_RSHIFT|ALT
0x25|SHIFT,0x09|LSHIFT|RSHIFT
0x25,0x0d|LSHIFT|RSHIFT

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

# [à] + [RALT]            =>     [@]
# 0x27 or 39
0x27|RALT,0x2b|NO_LSHIFT|NO_RSHIFT|ALT

# [)] + [RALT]            =>     ']'
# [)] + [SHIFT]           =>     [°]
# 0x2d or 45
0x2d|RALT,0x1b|NO_LSHIFT|NO_RSHIFT|ALT
0x2d|SHIFT,0x0c|LSHIFT|RSHIFT|NO_ALT

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

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

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

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

# [m]                     =>     [m]
# 0x33 or 51 or m
0x33,0x27

# [ù] + [SHIFT]           =>     [%]
# [ù]                     =>     [ù]
# 0x34 or 52
0x34|SHIFT,0x28|LSHIFT|RSHIFT|NO_ALT
0x34,0x28|NO_ALT

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

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

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

# [!] + [SHIFT]           =>     [§]
# [!]                     =>     [!]
# 0x38 or 56
0x38|SHIFT,0x07|NO_LSHIFT|NO_RSHIFT
0x38,0x09

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


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