Re: [hatari-devel] Enhanced keymap support

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


Hello,

First, Happy new year !

I just tried to add some mapping in config file to obtain 'æ' and 'Æ'.
These keys do not appear on french PC keyboard but may be obtained on
X in Linux in  with 'a' key and Alt Gr modifier for 'æ' and with
'a' key, Alt Gr and (LSHIFT or RSHIFT) modifiers for 'Æ'.

As Key 'a' with Alt Gr modifier is assigned to 'record animation'
in default Hatari configuration, i tried to use LALT modifier.

--------------------------------------------------------------------------------
Case A
--------------------------------------------------------------------------------

Keymap configuration file :

# æ
0x14|LALT,ALT_XXX|145
# a
0x14,0x10

Input keyed in EmuCon :

- Key 'a' without modifier => OK, symbol 'a' displayed, trace :

key mapping from file: host 0x64 => guest 0x60
key down: sym=97 scan=20 mod=0x1000 name='A'
key mapping: 10 (keymap)
key map: sym=0x61 to ST-scan=0x10
key up: sym=97 scan=20 mod=0x1000 name='A'
  LSHIFT:0 RSHIFT:0 CTRL:0 ALT:0

- Key 'a' + LALT modifier => OK, symbol 'æ' displayed, 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 down: sym=97 scan=20 mod=0x1100 name='A'
key mapping: 91 (keymap)
key map: sym=0x61 to ST-scan=0x91
key mod(s): ALT_XXX (0x38) + '1' (0x6d) + '4' (0x6a) + '5' (0x6b)
key up: sym=97 scan=20 mod=0x1100 name='A'
key mod(s): ALT_XXX (0x38)
  LSHIFT:0 RSHIFT:0 CTRL:0 ALT:1
key up: sym=1073742050 scan=226 mod=0x1000 name='Left Alt'
  LSHIFT:0 RSHIFT:0 CTRL:0 ALT:0


--------------------------------------------------------------------------------
Case B
--------------------------------------------------------------------------------

Keymap configuration file :

# a
0x14,0x10
# æ
0x14|LALT,ALT_XXX|145

Input keyed in EmuCon :

- Key 'a' without modifier => OK, symbol 'a' displayed, trace :

key down: sym=97 scan=20 mod=0x1000 name='A'
key mapping: 10 (keymap)
key map: sym=0x61 to ST-scan=0x10
key up: sym=97 scan=20 mod=0x1000 name='A'
  LSHIFT:0 RSHIFT:0 CTRL:0 ALT:0

- Key 'a' with LALT modifier => KO, no symbol displayed, 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 down: sym=97 scan=20 mod=0x1100 name='A'
key mapping: 10 (keymap)
key map: sym=0x61 to ST-scan=0x10
key up: sym=97 scan=20 mod=0x1100 name='A'
  LSHIFT:0 RSHIFT:0 CTRL:0 ALT:1
key up: sym=1073742050 scan=226 mod=0x1000 name='Left Alt'
  LSHIFT:0 RSHIFT:0 CTRL:0 ALT:0


--------------------------------------------------------------------------------
Case C
--------------------------------------------------------------------------------

Keymap configuration file :

0x14|LALT,ALT_XXX|145
0x14|LALT|LSHIFT,ALT_XXX|146
0x14,0x10

Reloading file => Error, trace :

....
key mapping from file: host 0x14|LALT => guest ALT_XXX|145
ERROR: extra 'LSHIFT', PC/SDL modifier already set
WARN : Failed to parse host (PC/SDL) part '0x14|LALT|LSHIFT' of line ...
key mapping from file: host 0x14 => guest 0x10
....



Questions :

1) Why case A and B configurations give different results ?

2) Why several modifiers are not authorized on host side in case C ?

   Hatari version with enhanced keymap patches reports this error
   in HostSpecToKeymap function :

   ...
    /* is it modifier? */
    mod = GetSdlModifier(token);
    if (mod)
    {
        if (mods)
        {
            Log_Printf(LOG_ERROR, "extra '%s', PC/SDL modifier already set\n", token);
            return false;
        }
        mods = mod;
        continue;
    }
   ...

   mods could be rather or-ed with mod ?

Yves

Le 11/12/2021 à 23:29, Eero Tamminen a écrit :
Hi,

Thanks for verifying that the ALT_XXX fix works.

I'll be looking at PortMidi / MIDI stuff this weekend, so I'll have time to look into NOxxx only later.


    - Eero




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