microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.83k stars 6.58k forks source link

[KBM] Shift Right remains logically pressed in this particular scenario #5982

Open DanCaprine opened 4 years ago

DanCaprine commented 4 years ago

Computer Information

Steps to Reproduce image

NOTE: it only reproduces remapping Shift, it doesn't reproduce remapping Shift (right) or Shift (left)

  1. Create a shortcut in Keyboard Manager mapping SHIFT + F1 to F13
  2. Create a shortcut in Keyboard Manager mapping SHIFT + F2 to F14
  3. Go to https://keycode.info/ in Firefox or Edge. Verify that F1 and F2 work correctly.
  4. Press and hold SHIFT Right and F1. Verify the web page is seeing an F13 keycode.
  5. While still holding SHIFT Right, release F1 and press F2.
  6. Verify the web page is seeing an F14 keycode.
  7. Release all buttons.

Result:

NOTE: see comment below by @enricogior

Expected Behavior

crutkas commented 4 years ago

@arjunbalgovind ideas?

arjunbalgovind commented 4 years ago

I'm unable to repro the above behavior on 1909. I will have to see if I can repro this on 2004. @DanCaprine if you get stuck in that state, tapping the Shift key should release the Shift key state, and your Win key should function normally. Similarly tapping F1 and F2 should reset those keys. If Shift is held down then pressing Win key does not do anything which is probably what happened in your case. Did you have any application which was running as admin in the foreground? You could get stuck into this broken state if you hold Shift and press F1 but release them when a window running as admin is in the foreground (this could happen if in your case either F13 was actually a hotkey to launch some application as admin or resulted in a UAC prompt). If that is indeed the case, you can avoid the behavior by running PowerToys as admin.

DanCaprine commented 4 years ago

@arjunbalgovind I can still reproduce this when PowerToys is running as admin, and clicking shift doesn't reset. However, this bug only occurs with "shift", which you need to select manually, and not "shift (left)" or "shift (right)", which might be relevant to testing.

Computer-Tsu commented 4 years ago

I have lost Win key function since about PowerToy ver 20? and currently at v0.20.1 Tried turning Shortcut Guide on and off as well as Keyboard Manager. Keyboard Manager has no shortcuts in it. PowerToys running in admin mode. Attempting to create a new mapping with Win mapped to Win Right or Win Left has not restored the key.

enricogior commented 3 years ago

I've updated the repro steps since it only happens remapping Shift, it doesn't reproduce remapping Shift (right) or Shift (left). To reproduce it, you have to use Shift (right) while holding F1 and F2. The bug causes Shift to remain logically pressed and opening Notepad and typing any letter shows that. Pressing both Shift (right) and Shift (left) at the same time, reset the logic state of Shift.

Tested on 0.29.3.