Community Center | Not monitored
Tag not monitored by Microsoft.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I wrote a program for a customer service agent who uses windows 10. A hotkey is bound using the keyboard module, and it works like a charm, UNTIL the user presses CapsLock to swap to Microsoft IME Japanese.
Once that swap is made, the hotkey that my program has bound does not function anymore, and the program must be restarted.
I checked the key output in each keyboard mode, and they both output the same char, ' \ '.
Could someone speculate as to what the problem could be, and perhaps even a potential resolution?
`import keyboard keyboard.add_hotkey('\', callFunction)`
Tag not monitored by Microsoft.
In my case, the same problem occurs when I press the corresponding key on the 103/106 keyboard, which has separate Korean/English conversion keys.
When monitoring keystrokes using python -m keyboard, keyup events do not occur for those keys.
It seems that the IME keys affect shortcut key combinations.
I'm looking into a way to initialize the IME key by triggering a keyup event, but it's not easy.
An easier solution is to register both combinations ("\", "hangeul+\") as shortcut keys when registering shortcut keys.
keyboard.add_hotkey('\', callFunction)
keyboard.add_hotkey('hangeul+\', callFunction)