Re: [hatari-devel] Enhanced keymap support

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


Hello,

Continuing with enhanced keymap, i tried to adjust the code which remaps SDL key to ST key. Patch 0012-Fix-Single-Mod-Host-Parsing.patch allowed several host modifiers to be or-ed together as specified in configuration file but this was not plainly used in Keymap_RemapKeyToSTKey function where only the SHIFT modifier was tested : if (pcmod == KMOD_SHIFT)...

All the modifiers which have KMOD_Lxxx and KMOD_Rxxx have KMOD_xxx = KMOD_Lxxx | KMOD_Rxxx. So i wrote a patch allowing SHIFT, CTRL, ALT, GUI to function together as SHIFT did alone (Function GetSdlModifier already returned the good KMOD_xxx value and only comments with
'both of above' needs to be changed to 'either of above')

In attachment :
1) the serie of patches for enhanced keymap : enhanced_keymap_patches.tar.gz
   containing the last patch 0013-Remap-mod-left-or-right.patch. This serie must be applied to master. 2) Keymap for french PC keyboard as i changed the documentation and some host LSHIFT
   or RSHIFT to SHIFT.

Do you agree with these changes ?

Regards,
Yves

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

#-------------------------------------------------------------------------------
#
# Hatari Key mapping for French PC Keyboard when patches for enhanced keymap
# are applied to master.
#
# These patches are :
#
# 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-left-or-right.patch
#
# they are filed in enhanced_keymap_patches.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.
#
# ALT_XXX is a special case where ST scancode is the decimal code
# (32 to 255) in atari character table.
#
# Lines beginning with a hash '#' are comments.
#-------------------------------------------------------------------------------
#
# 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.
#-------------------------------------------------------------------------------
#
# Comments before mappings show host symbols found on the keyboard :
# symbol (no modifier) --- symbol (SHIFT) --- symbol (RALT)
#
# or host symbols not found on the keyboard but useful
# symbol (LALT)  --- symbol (LALT and SHIFT)
# symbol (LCTRL) --- symbol (LCTRL and SHIFT)
#-------------------------------------------------------------------------------
#
# Warning: remember Hatari uses shortcuts to specific functions
# in keyboard setup and number of these shortcuts use RALT modifier.
#-------------------------------------------------------------------------------

# q --- Q
0x04,0x1e

# e --- E --- €
0x08|RALT,ALT_XXX|238

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

# œ --- Œ
0x12|LALT|SHIFT,ALT_XXX|181
0x12|LALT,ALT_XXX|180

# æ --- Æ
0x14|LALT|SHIFT,ALT_XXX|146
0x14|LALT,ALT_XXX|145

# a --- A
0x14,0x10

# z --- Z
0x1a,0x11

# w --- 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 --- ^
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 --- 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,ALT_XXX|221
0x38,0x09

# ≤ --- ≥
0x64|LALT|SHIFT,ALT_XXX|242
0x64|LALT,ALT_XXX|243

# « --- »
0x64|LCTRL|SHIFT,ALT_XXX|175
0x64|LCTRL,ALT_XXX|174

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


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