Thursday, 26 December 2019

autohotkey - How is it possible to find user's keyboard layout change method?


I've written an AutoHotKey script which changes keyboard layout by pressing CapsLock.
Pressing CapsLock simply emulates "LeftAlt down + Left Shift + LeftAlt Up" combination.
It's obvious, that my program won't work if Control+Shift is set to keyboard layout change method.
I've tried searching over registry, but there's no useful information in HKLM/System/CurrentControlSet/Control/Keyboard Layout(s).

So, is it possible somehow to find out user's method to change layout?



Answer




The information you're looking for is stored in the following registry key:


HKEY_CURRENT_USER\Keyboard Layout\Toggle

The key sequence is determined by the Layout Hotkey value:


1 = Left Alt + Shift
2 = Ctrl + Shift
3 = Not assigned
4 = Grave accent

When the value is missing, that means the default setting is being used (i.e. Ctrl + Shift).


References



No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...