Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KBM]: Remap of PgUp/Home, PgDown/End doesn't work with SHIFT #3478

Closed
fourpastmidnight opened this issue May 21, 2020 · 16 comments
Closed

[KBM]: Remap of PgUp/Home, PgDown/End doesn't work with SHIFT #3478

fourpastmidnight opened this issue May 21, 2020 · 16 comments
Assignees
Labels
Issue-Bug Something isn't working Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@fourpastmidnight
Copy link

Environment

Windows build number: Microsoft Windows [Version 10.0.18363.836]
PowerToys version: 0.18.0
PowerToy module for which you are reporting the bug (if applicable): Keyboard Manager

Unfortunately, I have a less than desirable keyboard layout on my laptop that I've struggled with for 8 or so years. I tried the standard Windows Keyboard mapper utility years ago, but it did not do what I wanted. Fast forward to yesterday, and I installed the PowerToys and discovered I can map the keys I want. And it seemingly worked! Yay. Except...then it didn't.

My keyboard requires me to use Fn+PgUp for Home and Fn+PgDn for End. Being a programmer, that is extremely non-ideal.

Steps to reproduce

So, I implemented the following mappings:

  • PgUp -> Home
  • Home -> PgUp
  • PgDn -> End
  • End -> PgDn

As I indicated, these keys are remapped as desired. However, all was not working as I had hoped.

Actual behavior

However, while coding in Visual Studio, I went to highlight a line of code using Shift+Home. But the line was not highlighted. The cursor simply moved to the beginning of the line. The same was true for Shift+End, the cursor was simply moved to the end of the line. (I just tried in the web browser in this here issue editor, and the same thing happens when using those key combinations.)

Additionally, the same behavior is true of Shift+PgUp and Shift+PgDn: the cursor moves to the beginning/end of a page of text but does not cause a selection to occur.

And again I remind you, that in order to access the physical Home and End keys on my laptop keyboard requires the use of the Fn key—perhaps that has something to do with "losing" the Shift modifier.

Surprisingly, Ctrl+Home and Ctrl+End result in the correct behavior. And, Ctrl+PgUp and Ctrl+PgDn work, too. (And again, two of these key combos also require the use of the Fn key—so it's odd that there doesn't seem to be a problem with Ctrl but there is with Shift.)

Expected behavior

I expect that using the Shift modifier with any remapped keys would work as with any other keyboard key modifier.

@arjunbalgovind arjunbalgovind added Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager Issue-Bug Something isn't working labels May 21, 2020
@arjunbalgovind
Copy link
Contributor

Thanks for finding this @fourpastmidnight . I was able to reproduce the same issue on my keyboard even though I don't have the Fn key based Home/End, which means it is unrelated to your Fn key. We'll look into it.

@fourpastmidnight
Copy link
Author

Awesome, glad to hear it's not related to Fn. I'm looking forward to when this is fixed. Thanks again!

@crutkas crutkas added this to the v1.0 Release milestone May 22, 2020
@arjunbalgovind
Copy link
Contributor

I'm not able to reproduce this any more for some reason. @fourpastmidnight are you still consistently getting this issue? I don't remember the exact scenario I was able to repro this, so I'll keep an eye out for it, since I have an MSI laptop with the same Fn key based Home/End as well.

@fourpastmidnight
Copy link
Author

fourpastmidnight commented Jun 5, 2020 via email

@fourpastmidnight
Copy link
Author

Ok, I just installed 0.18.2 and, unfortunately, this issue is still occurring for me. I tried in both a Visual Studio text editor and the venerable Notepad.

@crutkas
Copy link
Member

crutkas commented Jun 6, 2020

@fourpastmidnight our release notes didn't say this was fixed there. @arjunbalgovind is having issues reproducing it which is making it hard to fix. :(

@fourpastmidnight
Copy link
Author

fourpastmidnight commented Jun 6, 2020 via email

@shupoval
Copy link

shupoval commented Jun 8, 2020

I have a similar keyboard layout that was reported by @fourpastmidnight in this issue and can confirm that I can reproduce this issue on 0.18.2.

Steps to reproduce and the behaviour reported are the same.

The keyboard layout that I have on my Dell Latitude 5500 is the same as on the following image
image

I hope this issue can be fixed.

@shupoval
Copy link

shupoval commented Jun 8, 2020

What I've also discovered and hoped that it could be useful in order to further troubleshoot this issue is the following (for more details please take a look into gif recording below):

  1. implement the mapping as described in this issue
  2. open the "Remap a shortcut" dialog of the Keyboard Manager tool
  3. press the "shift" and "remapped" "page up => home" button. The expected result would be "Shift + Home" short cut and it will be as the final result but there is also an intermediate side effect -
    just a "Home" button pressed for a small amount of time.
  4. try to reproduce the same actions as described in the previous step and you won't get that intermediate side effect (just a Home button pressed).

That is why I assume that this can explain why the "Ctrl + Home" work and the "Shift + Home" don't for the same mapping.

0cJMAvSg7Z

@arjunbalgovind
Copy link
Contributor

Yup, that seems to be whats causing the problem. On my system it doesn't show the intermediate Home button pressed. Do you have an extra keyboard apart from your laptop keyboard with which you can check if it happens there as well? Or maybe with the on-screen keyboard? To check if its a keyboard specific thing or not.

@martinitus
Copy link

I'm on a thinkpad keyboard and have the same remapping and the same issue.
Given my cursor is at the end of the line, pressing "shift page up" which should be mapped to "shift home" selects a whole page upwards instead of only the current line.

On my old windows 7 system, is used to directly remap the keys via registry entries which worked as expected.

@fourpastmidnight
Copy link
Author

@lRushl, @arjunbalgovind I tried the steps above and this is happening for me, too. Good find.

@arjunbalgovind
Copy link
Contributor

arjunbalgovind commented Jun 19, 2020

I finally got a reliable repro on this. Not entirely sure why this happens, but it looks like NumLock seems to be messing things up. When NumLock is off, Shift+Home/PgUp should work as expected, but when is turned on then Shift+Home sends only Home then followed by Shift and I can reproduce the behavior @lRushl mentioned. Thanks for finding this @fourpastmidnight and thanks for the insight @lRushl. Now that we have a clear idea of "what's happening" it should be much easier to fix.

@fourpastmidnight
Copy link
Author

@arjunbalgovind I tested turning off NumLk and then using Shift+Home and it worked as expected! Wow, that's really strange.

@arjunbalgovind
Copy link
Contributor

@fourpastmidnight we've got a fix for it and this should be working in our next release! :) Turns out there was a bug in the way we were handling Home, End, Del, Ins, Pg keys and the arrow keys. We were sending the NumPad equivalents of those keys rather than the normal variants (we were missing a flag that was to be set), which is probably why the behavior was weird when NumLock was on, since those keys aren't supposed to exist. This was also causing two other bugs as well with completely random and not obvious side effects like this one.

@arjunbalgovind arjunbalgovind added Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed Status-In progress This issue or work-item is under development labels Jun 25, 2020
@crutkas
Copy link
Member

crutkas commented Jun 30, 2020

Fixed in 0.19.0, please visit https://github.com/microsoft/PowerToys/releases/ for the latest release

@crutkas crutkas closed this as completed Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests

5 participants