[Shortcut Guide] Add Windows key hold activation options - #49637
[Shortcut Guide] Add Windows key hold activation options#49637Niels Laute (niels9001) wants to merge 2 commits into
Conversation
Add independent Windows-key hold modes, configurable timing, and close-on-release behavior while preserving the regular activation shortcut. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b8ffa76b-3cf0-4a67-9adb-a13c5dd9f125
|
Thank you for contributing to PowerToys. We've detected that this PR might include a new or modified telemetry event. Please ensure the following before merging:
|
There was a problem hiding this comment.
Pull request overview
Adds configurable “hold Windows key” activation behaviors for Shortcut Guide (Off / taskbar indicators / open full guide), keeping the regular activation hotkey independent, and wires the new behavior end-to-end across Settings UI, Runner hook plumbing, module interface, and the Shortcut Guide UI.
Changes:
- Introduces new settings fields (Windows-key action, hold duration, close-on-release) with UI + localization + view model logic and unit tests.
- Updates Runner keyboard-hook pressed-key action handling (per-module clearing) and adds a dedicated Windows-key trigger event routed through the module interface to the UI process.
- Extends Shortcut Guide UI to listen for the new Windows-key trigger event and handle left/right Windows keys, plus telemetry and docs updates.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/settings-ui/Settings.UI/ViewModels/ShortcutGuideViewModel.cs | Adds new Settings-backed properties for Windows-key action, press time clamping, and close-on-release. |
| src/settings-ui/Settings.UI/Strings/en-us/Resources.resw | Adds localized strings for new Shortcut Guide Windows-key settings. |
| src/settings-ui/Settings.UI/SettingsXAML/Views/ShortcutGuidePage.xaml | Adds Settings UI controls (ComboBox + NumberBox + CheckBox) for Windows-key hold behavior. |
| src/settings-ui/Settings.UI.UnitTests/ViewModelTests/ShortcutGuide.cs | Updates back-compat test expectations and adds tests for defaults, normalization, clamping, and persistence. |
| src/settings-ui/Settings.UI.Library/ShortcutGuideWindowsKeyAction.cs | Introduces an enum for Windows-key activation actions. |
| src/settings-ui/Settings.UI.Library/ShortcutGuideProperties.cs | Adds new persisted properties and shared press-time constants (min/max/default). |
| src/runner/powertoy_module.cpp | Clears pressed-key actions on hotkey refresh and routes Win-key long press through a dedicated module callback. |
| src/runner/centralized_kb_hook.h | Adds API to clear pressed-key actions per module. |
| src/runner/centralized_kb_hook.cpp | Implements per-module pressed-key action clearing and ensures timers are killed when clearing. |
| src/modules/ShortcutGuide/ShortcutGuideModuleInterface/dllmain.cpp | Adds Windows-key trigger event + settings parsing for new fields; triggers UI via dedicated event. |
| src/modules/ShortcutGuide/ShortcutGuide.Ui/Telemetry/ShortcutGuideSettingsEvent.cs | Extends telemetry payload with Windows-key action/press-time/close-on-release fields. |
| src/modules/ShortcutGuide/ShortcutGuide.Ui/ShortcutGuideXAML/App.xaml.cs | Listens to both trigger events and implements Windows-key-triggered overlay behavior (LWIN/RWIN + close-on-release). |
| src/modules/ShortcutGuide/ShortcutGuide.Ui/Program.cs | Passes/consumes Windows-key trigger event name argument; extends telemetry logging parameters. |
| src/modules/interface/powertoy_module_interface.h | Adds on_win_key_long_press() hook to decouple Win-key long-press from normal activation. |
| src/common/interop/shared_constants.h | Adds a new named event constant for Windows-key trigger. |
| doc/dsc/modules/ShortcutGuide.md | Documents new DSC-configurable properties and updated behavior/ranges/examples. |
| doc/devdocs/modules/shortcut_guide.md | Updates developer docs for new activation modes and fixes a broken markdown link. |
Guard malformed settings properties and avoid arming Windows-key release handling when the overlay is already visible. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b8ffa76b-3cf0-4a67-9adb-a13c5dd9f125
|
Fixed it in #49661 |
Summary of the Pull Request
Adds configurable Windows-key hold activation to Shortcut Guide while keeping the regular activation shortcut independent.
Users can choose to disable Windows-key activation, show taskbar indicators, or open the full Shortcut Guide. Full-guide mode also supports a configurable hold duration and optional close-on-release behavior.
PR Checklist
Detailed Description of the Pull Request / Additional comments
press_timesetting and documents the new options.Validation Steps Performed
ShortcutGuide.UnitTests: 7/7 passed.