Powertoys: Keyboard Manager shortcut remaps can stop working after using Japanese IME keyboard

Created on 25 Jul 2020  路  9Comments  路  Source: microsoft/PowerToys

Steps to reproduce

  • Change keyboard language to Japanese IME
  • Use either the Ctrl+CapsLock, Shift+CapsLock or Alt+CapsLock shortcut.
  • Try invoking shortcut guide, or try invoking a keyboard manager shortcut to shortcut remap

Expected behavior


Shortcut guide appears, and the keyboard remap works.

Actual behavior


Shortcut guide doesn't appear and the keyboard manager shortcut remap doesn't work

Why is this happening?

I observed the above behavior while testing out another bug with KBM and the Japanese keyboard. The Japanese IME switching shortcuts (listed above in the repro steps) run at a lower level than low level keyboard hooks. When Shift+Caps Lock is pressed, low level hooks never receive a Caps Lock key event, and instead a key down event with virtual key code 0xF0 is received (which is documented as OEM specific in the virtual key code list). Once this is set to key down, it never gets released until you press Ctrl+CapsLock or Alt+CapsLock which will release 0xF0, but will instead set 0xF1/0xF2 respectively. These key states do not get reset until reboot. Because of this, both KBM and Shortcut guide will see this key as being pressed if that virtual key code is checked.

In both SG and KBM shortcut to shortcut remaps, there is logic where we iterate over all the key codes to ensure no other keys have been pressed. Since this includes 0xF0, 0xF1 and 0xF2, this would cause them to never work.

Issue-Bug Product-Keyboard Shortcut Manager Resolution-Fix-Committed

All 9 comments

@enricogior @crutkas if we have received any "Shortcut Guide not working" reports from users that work with Japanese keyboards this is most likely the reason for it. It's a quick fix too.

I don't think we have ever asked what IME they are using.

@arjunbalgovind
this is the only report that I'm aware of https://github.com/microsoft/PowerToys/issues/4460
Thanks for looking into this.

I have same issue. When i press Alt+` for IME on, Keyboard Manager shortcut suddenly stop working until OS reboot.

v0.20.0
Windows10 1909

I've removed the "Shortcut Guide" label since the bug is tracked by https://github.com/microsoft/PowerToys/issues/4460 and fixed by https://github.com/microsoft/PowerToys/pull/6025 for the Shortcut Guide

Unfortunately, it didn't work in my case with v0.23.

@arjunbalgovind
Could you take a look at my case, please? I'm using Alt+` for IME switching. Corresponding virtual key code is VK_KANJI(0x19).

@tsu1980 I can repro it though it doesn't happen every time with Alt+`, but I have identified the cause of the bug.
@crutkas should I re-open this issue? It seems there are some cases where it isn't fixed

actually, lets create a targetted issue for you @tsu1980

Was this page helpful?
0 / 5 - 0 ratings