Page 1 of 1

Remapped hotkeys behave strange in other locales

Posted: 21 Nov 2017, 21:08
by Micromegas
When the keyboard locale is switched, it leads to some confusion for the user that the changed keys also affect control sequences, such as ^z which will act like ^w on a French keyboard layout. I thought to solve this with the following code:

Code: Select all

; Some standard settings
#NoEnv
#Warn
SendMode Input
#SingleInstance force

; Remapping of some keys:
^SC002::^1		; 1
^SC032::^m		; en: m fr: ,
^SC033::^,		; en: , fr: ;
^SC027::^;		; en: ; fr: m de: รถ

; Some control actions for testing:
^1::msgbox 0, , little one, 1
+^1::msgbox 0, , Big One, 1
^m::msgbox 0, , mineur, 1
+^m::msgbox 0, , Majeur, 1
^,::msgbox 0, , comma, 1
+^,::msgbox 0, , Less Than, 1
^;::msgbox 0, , semicolon, 1
+^;::msgbox 0, , Whole Colon, 1
This produces the following strange behaviors:
  1. With French keyboard layout, ^SC002 (the number 1) gives the message "Big One", even when no Shift is pressed.
  2. With French or Greek keyboard layout, ^SC027 (the key to the right of L) produces nothing.
  3. With German keyboard layout, ^SC027 (the key to the right of L) produces "Less Than", even when no Shift is pressed.
  4. With German keyboard layout, ^SC033 (the comma) produces nothing.
  5. With Greek keyboard layout, ^SC032 (the M) writes a Latin "m", regardless whether Shift is pressed.
(Simplified Chinese works well for these keys.)

I found nothing about this behavior under Remapping Keys and Buttons. Even though the different cases have different results, I hope that if we find the reason for one strange behavior we may also learn how to address the others.