Powertoys: Shortcut Remaps can stop working on using Alt+` in Japanese IME

Created on 1 Oct 2020  ·  9Comments  ·  Source: microsoft/PowerToys

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).

_Originally posted by @tsu1980 in https://github.com/microsoft/PowerToys/issues/5225#issuecomment-701720976_

ℹ Computer information

  • PowerToys version: 0.23
  • PowerToy Utility:
  • Running PowerToys as Admin:
  • Windows build number: [run "winver"]

📝 Provide detailed reproduction steps (if any)

  1. Switch to Japanese keyboard
  2. Press Alt+` a couple of times

✔️ Expected result

_What is the expected result of the above steps?_
Remaps should be unaffected

❌ Actual result

_What is the actual result of the above steps?_
Shortcut to shortcut remaps stop working

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

All 9 comments

Unfortunately, it didn't work with v0.23.2 either.

I looked at #6952 and it looks like 0x19 is not excluded.
Does that mean It doesn't need to exclude 0x19?

@tsu1980 0x19 is not a reserved key code, on switching to Kanji IME that key code gets pressed and released, so it should not cause any issues to the shortcut remaps. Can you share some more information about your exact repo scenario? I'm able to use Alt+` to switch IME and then I can use shortcut remaps like Ctrl+A->Ctrl+V. Can you send a screenshot of your set of remappings?

@arjunbalgovind
Let me explain my situation in detail.

First of all, I'm using a US keyboard and Google IME.

My KBM configuration screen is as follows.

KBM

I checked in the KeyboardStateView and found the following keycodes.

  1. press ALT(0x12, 0xa4)
  2. press the Kanji(`) key(0x19, 0xf2, 0xf4, 0xf0, 0xf3)
    When I press and hold down the Kanji(`), 0x19 will remain in the pressed state, while 0xf2, 0xf4 and 0xf0, 0xf3 will repeat the pressed and unpressed states with each other.
    Kanji(`) key is located above the TAB key.

KSV

Thanks for the details @tsu1980, I am able to reproduce the issue, but it doesn't happen always. Sometimes pressing Alt+` again resets it back correctly (which is different from the others 0xF0-0xF4 because some of them never get toggled back).

@crutkas @ryanbodrug-microsoft I am not entirely sure what's the fix for this. An option is to just add all the IME keys to the "ignore list" when we search for keys that are being pressed when a shortcut is pressed, and that will fix this issue, but I don't know if it's the right thing to do. This behavior of VK_KANJI getting stuck feels like a Windows bug rather than something that you would workaround. It made sense to ignore the reserved keys, but keys which have a proper key code seems odd. The workaround is easy to do though, so if you think I should go ahead with that I can do it.

@tsu1980 The exact scenario which seems to cause the behavior is:

  • Press Alt
  • Press `
  • Release Alt
  • Release `

(Generally we would release ` before Alt, which is why this scenario doesnt repro every time we press Alt+`)

@arjunbalgovind
Thank you for your help.
I wasn't aware of the order in which those keys were pressed, but you may have been right.

@tsu1980 I have added a fix for it, and it should work for you in the next release

@arjunbalgovind
I was able to confirm that it works properly now with v0.25.0. Thank you!

Was this page helpful?
0 / 5 - 0 ratings