Repository: PowerToys
Issue: [Keyboard Manager] Shortcut mapping of Ctrl+(Up|Left) to PgUp|Ctrl+PgUp stops working after alternation with Ctrl held down
Labels: Issue-Bug,Product-Keyboard Shortcut Manager

### Microsoft PowerToys version

0.55.2

### Running as admin

- [X] Yes

### Area(s) with issue?

Keyboard Manager

### Steps to reproduce

Create the following mappings (or similar ones using Right/Down/PgDown):
* Ctrl (any) + Left -> Ctrl (any) + PgUp
* Ctrl (any) + Up -> PgUp
![image](https://user-images.githubusercontent.com/3118390/153771349-3bf683ad-b0e0-4a81-8e37-413724dacae5.png)

Follow the following sequence (you can test Ctrl+PgUp in major web browsers to switch between active tabs):
* Hold down Ctrl 👇
* Left: successful ✔️
* Up: successful ✔️
* [Optional] Left: **ignored** ❌
* [Optional: any number of Up or Left]: Up is successful ✔️, Left is **ignored** ❌
* Release Ctrl 👍
* Hold down Ctrl 👇
* [Optional] Left: **ignored** ❌ ❗❗
* Up: successful ✔️
* Left: successful ✅ 🤔

---

I'm guessing that the related implementation is described by the comments at: https://github.com/microsoft/PowerToys/blob/3df2c5fe6a84514bff25adfc0e31a1de84c2c906/src/modules/keyboardmanager/KeyboardManagerEngineLibrary/KeyboardEventHandlers.cpp#L330

---

## Setup motivation context

Laptop manufacturers like Dell have been recently on a spree to further reduce usability of laptop keyboards, trying to fix problems that never existed, and now all power users (those of us that use keys like PageUp/PageDown on a daily basis) have to collectively share these consequences. The abovementioned shortcuts are my attempt to make it easier to use layouts like the one illustrated here, where you have to use Fn, which on top of requiring an additional key also requires using both hand. (Due to hardware limitations it's impossible to map Right Ctrl to Fn + Ctrl directly.) By "sacrificing" the totally redundant right Ctrl, with the new shortcuts it's enough to just use right hand for everything:

![image](https://user-images.githubusercontent.com/3118390/153772564-f3af4ef7-2cf1-4a05-a8c6-8b4fcfcde4f4.png)

Some additional resources to illustrate the sentiment around this criticism:
* <sub>https://www.dell.com/community/XPS/How-can-I-use-the-PgDn-key-without-having-to-also-use-the-Fn-key/td-p/7860565</sub>
* <sub>https://www.dell.com/community/Laptops-General-Read-Only/Lack-of-PgUp-PgDown-Home-End-keys-PAIN/td-p/5018484</sub>
* <sub>https://www.reddit.com/r/Dell/comments/6d3o72/why_doesnt_the_xps_15_9560_have_dedicated_page/</sub>
* <sub>https://www.reddit.com/r/Dell/comments/3rhouw/page_updown_homeend_buttons_on_xps_15/</sub>
* <sub>https://www.reddit.com/r/Dell/comments/8expxj/poor_keyboard_designs_on_recent_dell_laptops/</sub>
* <sub>https://www.reddit.com/r/Dell/comments/62aeqh/xps_9550_page_updown/</sub>
* <sub>https://www.reddit.com/r/Dell/comments/fqxmc7/xps_13_7390_vs_9300_keyboard_a_pedantic_comparison/</sub>

---

As a separate **feature suggestion**, it would be great if common use-cases similar to this one could be officially tracked & supported; not only as part of test coverage, but possibly even as predefined presets available in the form of community-driven suggestions for specific use-cases. For example, if there is any (subjectively) better solution that thousands of users are already satisfied with, _(especially if some shortcuts are infeasible due to hardware keyboard limitations, or even OS-level -> in which case however the advantage of PowerToys over something like AutoHotKeys or any Linux could be the implicit support from Microsoft when it comes to resolving issues of compatibility between their own products)_, I'm sure that more of us would be happier with accepting some well-documented and well-tested layouts rather than reinventing wheels by trial and error.
* If some shortcuts (like this one) have known issues, even that could be documented as part of "discouraged presets", automatically looked-up and displayed if one matches current user-defined shortcut. (https://github.com/microsoft/PowerToys/issues/16286 would provide a synergy if these presets included comments too, as this may be one example of a shortcut worth commenting.) Even if just manually maintained in repo, comments could link shortcuts to GitHub issues (assuming more get discovered in a future). Scenarios of well-known risks could include shortcuts predictably conflicting with popular software, which would motivate a discussion and rating of such presets.

### ✔️ Expected Behavior

The shortcuts should always get translated.

### ❌ Actual Behavior

Two separate issues; not only is the behavior different depending on whether the shortcuts were pressed during the same Ctrl modifier keydown, but it's even stateful and persists throughout different key actions until Ctrl+Up is pressed again.

This was tested on two separate systems, using both a built-in keyboard and an external one.

### Other Software

_No response_