pieter-degroote/UltimateKEYS

On Windows with AHK, Right Alt + Shift triggers input method switch.

zyxir opened this issue · 4 comments

zyxir commented

While using UltimateKEYS on Windows as an AutoHotkey script, some unexpected behavior is observed. If I want to input the letter "É", I would press Right Alt + Left Shift + G. However, the "Alt+Shift" combination is the shortcut of input method switch on Windows, so the input method is switched, which is not an intended behavior. If you have more than one input method installed on your Windows, you would observe the same thing.

I wonder if there is a way to hide the Alt+Shift combination from the system?

Well, perhaps you have put your keyboard layout (in Windows) on something else than 'US QWERTY'.
The AHK scripts (in this repository) are 'crafted' for just that layout. (Perhaps it is compatible with a "US QWERTY + Chinese" layout by 'coincidence'.)
See : "these are overlay scripts, specifically designed for the keyboard layout 'US QWERTY'"

In the testing repository, you can also find a test version for the US-International layout (KBDUSX).

In cases where only US QWERTY is installed, the Alt+Shift combination does not cause any 'side effects'... Maybe, we can make it more compatible with non-Latin layout combinations, in certain issues occur which can be addressed.

zyxir commented

Okay. The layout of Chinese input method is based on US QWERTY, and the positions of keys is the same as US QWERTY, but it is indeed not US QWERTY. It is Chinese input method.(to some extent Windows treat input method and keyboard layout as the same thing) I'll try to read the code of US QWERTY in my spare time and hopefully solve this problem. Thanks!

Furthermore, it is important to know that the base US QWERTY layout has 2 times the Alt button (Left Alt and Right Alt).

On the contrary, the US-International layout (and many others) has only one Alt button (on the left) and the button on the right is called 'AltGr' (from Alt(ernate) Graph).

That way, you see that there is a difference between them :

Normal scripts for standard US QWERTY
Scripts for US-International layout (KBDUSX, testing)

In the documentation of AutoHotkey, you find :

>! : Right Alt (US QWERTY)
<^>! : AltGr (US-Int. and many others)

The plus sign in >!+ and <^>!+ indicates that the Shift key (either Left or Right Shift) is also held down during the sequence.

In the documentation and the layout image, I currently refer to it as 'AltGr' (and sometimes also 'Right Alt'), mostly for simplicity towards the end user.

zyxir commented

Furthermore, it is important to know that the base US QWERTY layout has 2 times the Alt button (Left Alt and Right Alt).

On the contrary, the US-International layout (and many others) has only one Alt button (on the left) and the button on the right is called 'AltGr' (from Alt(ernate) Graph).

That way, you see that there is a difference between them :

Normal scripts for standard US QWERTY
Scripts for US-International layout (KBDUSX, testing)

In the documentation of AutoHotkey, you find :

>! : Right Alt (US QWERTY)
<^>! : AltGr (US-Int. and many others)

The plus sign in >!+ and <^>!+ indicates that the Shift key (either Left or Right Shift) is also held down during the sequence.

In the documentation and the layout image, I currently refer to it as 'AltGr' (and sometimes also 'Right Alt'), mostly for simplicity towards the end user.

Yes, I am fully aware of that. In any Chinese input method (or call it Chinese layout, as Windows 10 doesn't distinguish between a layout and an input method), there is no AltGr key, thus the left and right Alt key are both functioning as an Alt key.

You may don't know how Chinese input method works. The Chinese language does not consist of letters, but characters. And how a Chinese character is written is not directly connected to how it is pronounced: there could be tens of characters pronounced the same way, while each stands for a different meaning. There are approximately 90,000 Chinese characters in total, so it's impossible to map every Chinese character to one key at the keyboard. To solve this problem, some brilliant people invented something called input methods. While typing Chinese with an appropriate input method, I type the pinyin of the character we have in mind, and a popup will show up listing all available characters that correspond to the pinyin I typed.

Therefore, the keyboard layout doesn't matter for a Chinese input method, as pinyin is composed only of the 26 letters from a to z. What matter for a Chinese input method is how the characters are encoded, sorted, and the ability to forecast what the user want to input in order to reduce the amount of letters the user have to type. For Chinese input methods, the position of all the letters and punctuations is the same as a US QWERTY keyboard layout.