Re: [hatari-devel] Enhanced keymap support |
[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]
Hello, In attachment, you'll find the configuration of french PC keyboard mapping. 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. This one may be corrected with : 0x38|SHIFT,ALT_XXX|221 but this disables auto repeat 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 ? Yves Le 07/12/2021 à 14:22, Eero Tamminen a écrit :
Hi, There have been some changes in Hatari which cause the old patches not to apply any more. Updated & rebased patch series (that can be applied on top of the current Hatari Git head) is attached. - Eero On 7.12.2021 10.52, Yves Le Berre wrote:M. Tamminen,Could you re-post the "ordered" patches serie of enhanced keymap support ?When I tried to apply patches from hatari-devel list to master, I succeeded with the 8 patches dated 11-11-2021 00:50 but didn't succeed with the 3 patches dated 21-11-2021 21:24. Are they any other patches to apply ? Many thanks, Yves Le Berre Le 21/11/2021 à 21:24, Eero Tamminen a écrit :Hi, On 21.11.2021 18.36, Vincent Barrilliot wrote:I found some time this afternoon so I'm trying to have a look at it.Thanks for testing! Attached small patches should fix the usability issues.Rest aren't issues in my code, but things you need to take into account when doing mappings with SDL and Hatari, regardless of whether you use your own or my patches.See details below.First thing is that decimal stuff is a pain. The links you provide have the scancodes in hexa, I still don't understand why the heck you demand decimals in the config file ?As Hatari key mapping has always used decimals[1], it needs to continue interpreting values as decimals by default. Otherwise people's existing keymaps would break when they update their distro to a version having newer version of Hatari.But it could accept also hexadecimals when they are prefixed with 0x. Attached patch does that.[1] https://hatari.tuxfamily.org/doc/keymap-sample.txtAlso I don't like using symbols (e.g.) "Q" or stuff like that on the left. It means I have to care about US keyboard layout. > But if I want to create a keymap, it's because I have another type of keyboard, so why should I give a shit about US keyboards ? That doesn't make any sense. I'd rather have something consistent, i.e map scancodes to scancodes without some other country's keyboard being there like hair in my soup :DYou can always use numeric scancodes, both for SDL and ST key.For example, for 'ù' I must determine that this key is actually ";" on a US keyboard. So I'm mapping ";" not "ù". On my keyboard ";" is another key. How confusing is that ?The other attached patch should fix that bug, and third one improves what kind of SDL key names are accepted.(I didn't notice the bug as I was testing names where SDL scancode & symbolic name were pointing to same key. For backwards compatibility, names need to be interpreted as symbolic ones.)[...]I didn't get the AltGr to work.Hatari shortcuts eat most of the AltGr combos:https://hatari.tuxfamily.org/doc/manual.html#Keyboard_shortcuts_for_the_SDL_GUIYou can bind only keys that Hatari does not use itself.In the source code, I saw there is KMOD_ALT as meaning either "KMOD_LALT" and/or "KMOD_RALT". But on a normal keyboard, LALT is ALT and RALT is AltGr. These really don't have the same function/meaning, I don't think it's correct to bundle them under ALT. That is very misleading.I agree that special handling for left + right key really makes sense only for SHIFT.I can remove KMOD_ALT, along with KMOD_CTRL & KMOD_GUI.(Having those extra left+right defines is actually left-over from your patch. :-))Here's the map I tried (I had to look at a US keyboard layout and do hexa to decimal conversion, so plenty of room for errors).# Q -> A Q,16 # W -> Z W,17 # Z -> E Z,44 # # 3|SHIFT,43Although SDL has '#' as symbolic key name, it does not have a scancode to which it could be matched. See end of this list:https://wiki.libsdl.org/SDL_Scancode# { 4|RALT,27|ALT|RSHIFTAltGr + A is Hatari shortcut for recording video.After trying that key combo, you probably have largish video file somewhere...A,Z,E worked, # and { didn't.As you see from above, there are some gotchas with the old symbolic name mapping, and with the new modifier support, which I need to document before upstreaming these changes.I was not able to create a mapping for '[' to something. How do you name these keys ? (side note: using scancode would make things simpler). I didn't try the ALT_xxx or other things (CTRL, accents etc.) because this US keyboard indirection confused me and pissed me off.I think I'll stick to my patch, the parsing sure isn't as good as yours but it was tons easier for me to create a working map.Please stick with my patch set still for a while still, it's getting better.- EeroPS. Testing is better done by somebody who actually uses the feature fully, and is different from one who actually wrote the thing. As you can see, developer can easily miss things...
# # Hatari Key mapping for french pc keyboard (Patches from M. Eero Tamminen). # # Format used : # # Host (PC) scancode | Host modifiers , Guest (ST) scancode | Guest modifiers # # NB : Scancodes and modifiers (several possible) 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 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 accentuated vowel) 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 ############################################################################
Attachment:
french_pc_keyboard.png
Description: PNG image
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |