microsoft / microsoft/PowerToys
Feature Request: Context-Aware Shortcut State Machine (e.g., Display/Profile Based Hotkeys)
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 139k
- Forks
- 8.6k
- PR merge metrics
- PR metrics pending
Description
Description of the new feature / enhancement
Summary
Currently PowerToys Keyboard Manager only supports static, global remappings. This proposal adds a state machine layer that allows shortcuts to behave differently based on current context (e.g., active monitor, color profile, or user-defined state).
Proposed Behavior
- State definition – Users can define custom states (e.g., "Monitor1 mode", "Monitor2 mode")
- State switching – A dedicated shortcut can cycle through states
- Conditional remapping – Shortcut mappings can be set to only work when a specific state is active
- UI placement – This should live under an "Advanced / Experimental" section, off by default to avoid confusing casual users
Acceptance Criteria
· User can define 2-3 custom states
· A shortcut can cycle through states
· Shortcut mappings support state conditions
· Feature is off by default, behind an advanced toggle
Scenario when this would be used?
Use Case / Scenario
A concrete example:
· Same shortcut Ctrl+Win+Up:
· When Monitor A is active → adjust color temperature
· When Monitor B is active → toggle refresh rate
Another example:
· A "profile switch" shortcut cycles through 2-3 preset states (Gaming, Coding, Dark Room)
· Each state changes what other shortcuts do (e.g., brightness, volume, night light)
Supporting information
Additional Context
Keyboard Manager already supports app-specific remapping (targetApp). State-based remapping follows the same pattern — no changes needed to the low-level hooking logic, only the evaluation layer needs new conditions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by reviewing Keyboard Manager's existing app-specific remapping and its targetApp evaluation, then determine how user-defined states, state switching, conditional mappings, and the advanced opt-in setting would fit together. Done means the acceptance criteria are implemented, including 2–3 states, cycling, conditional shortcuts, and an off-by-default toggle.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100