Clint Rutkas 9fcb8faac5 [Quick Accent] Isolate press-and-hold activation (#49701)
## Summary of the Pull Request

Makes the **Press and hold the letter** activation method exclusive.
Pressing a legacy trigger key (Space or either arrow) before the hold
threshold now cancels that owner-letter gesture and passes the trigger
through normally, instead of allowing the already-scheduled picker to
appear later. Typing any different supported physical letter during the
gesture also cancels it, preventing that intervening character from
being replaced when the owner letter is released.

Space and arrow navigation remains available after a genuine hold
activation reaches its threshold.

## PR Checklist

- [ ] Closes: N/A
- [x] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [x] **Tests:** Added/updated and all pass
- [x] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: N/A

## Detailed Description of the Pull Request / Additional comments

The native keyboard listener previously armed press-and-hold on
owner-letter key-down and immediately queued a delayed managed render.
Although pre-threshold Space/arrows were excluded from native
trigger-key activation, they did not invalidate that pending render.
Holding the owner letter after pressing Space therefore still displayed
the picker and made both invocation systems feel enabled.

This change adds an explicit native-to-managed cancellation event and a
generation-based managed display state:

- In `PressAndHold`, Space or either arrow before the snapshotted hold
threshold cancels the current gesture and passes through without input
injection.
- Space/arrows at or after the threshold retain their intended picker
navigation behavior.
- Any different physical letter in Quick Accent's supported key set
cancels the owner gesture before passing through, even when that letter
has no mapping in the selected language.
- Owner repeats and owner key-up are handled from active physical
ownership rather than current language eligibility, so live language
changes cannot leave stale state.
- Activation mode, input time, and hold duration are atomically
published and snapshotted once per owner gesture. The native listener
passes the same delay snapshot to managed scheduling, so live settings
changes apply to the next gesture instead of desynchronizing native
interaction from picker visibility.
- Character data is prepared before native navigation can become
interactive, preventing accepted navigation from being dropped.
- Legacy Space/arrow/Both acquisition behavior is preserved.

The low-level hook has no clean deterministic native unit-test seam
because its private handlers depend on Win32 keyboard state. Managed
regression coverage exercises delayed-display cancellation, re-arming,
generation invalidation, and delay snapshot preservation.

## Validation Steps Performed

- Built `src/modules/poweraccent/PowerAccent.UI/PowerAccent.UI.csproj`
in `Debug|x64`, covering the native WinRT projection and managed
Core/UI.
- Built
`src/modules/poweraccent/PowerAccentKeyboardService/PowerAccentKeyboardService.vcxproj`
in `Debug|x64`.
- Built and ran all `PowerAccent.Core.UnitTests`: **35 passed, 0
failed**.
- Ran `git diff --check`.
- Performed focused code reviews of pre-threshold trigger cancellation,
intervening mapped/unmapped letters, live mode/duration snapshots,
language changes, owner key-up balance, and post-threshold navigation.

---------

Copilot-Session: cbd8418a-64cb-4c6c-8653-2f3f0a6ceb9e
2026-08-06 21:14:08 -07:00

Microsoft PowerToys

Microsoft PowerToys is a collection of utilities that help you customize Windows and streamline everyday tasks.

Installation · Documentation · Blog · Release notes

🔨 Utilities

PowerToys includes over 30 utilities to help you customize and optimize your Windows experience:

Advanced Paste icon Advanced Paste Always on Top icon Always on Top Awake icon Awake
Color Picker icon Color Picker Command Not Found icon Command Not Found Command Palette icon Command Palette
Crop and Lock icon Crop And Lock Environment Variables icon Environment Variables FancyZones icon FancyZones
File Explorer Add-ons icon File Explorer Add-ons File Locksmith icon File Locksmith Grab And Move icon Grab And Move
Hosts File Editor icon Hosts File Editor Image Resizer icon Image Resizer Keyboard Manager icon Keyboard Manager
Light Switch icon Light Switch Mouse Utilities icon Mouse Utilities Mouse Without Borders icon Mouse Without Borders
New+ icon New+ Peek icon Peek PowerDisplay icon PowerDisplay
PowerRename icon PowerRename PowerToys Run icon PowerToys Run Quick Accent icon Quick Accent
Registry Preview icon Registry Preview Screen Ruler icon Screen Ruler Shortcut Guide icon Shortcut Guide
Text Extractor icon Text Extractor Workspaces icon Workspaces ZoomIt icon ZoomIt

📦 Installation

For detailed installation instructions and system requirements, visit the installation docs.

But to get started quickly, choose one of the installation methods below:

Download the .exe file from GitHub

Go to the PowerToys GitHub releases, scroll down and select Assets to reveal the installation files, and choose the one that matches your architecture and install scope. For most devices, that would be x64 per-user.

Microsoft Store
You can easily install PowerToys from the Microsoft Store:

WinGet
Download PowerToys from [WinGet](https://github.com/microsoft/winget-cli#installing-the-client). Updating PowerToys via winget will respect the current PowerToys installation scope. To install PowerToys, run the following command from the command line / PowerShell:
  • User scope installer (default)
winget install Microsoft.PowerToys -s winget
  • Machine-wide scope installer
winget install --scope machine Microsoft.PowerToys -s winget
Other methods
There are [community driven install methods](https://learn.microsoft.com/windows/powertoys/install#community-driven-install-tools) such as Chocolatey and Scoop. If these are your preferred install solutions, you can find the install instructions there.

What's new?

What's new image

To see what's new, check out the release notes.

🛣️ Roadmap

We are planning some nice new features and improvements for the next releases a brand-new Shortcut Guide experience, ensuring it's easier to find and install Command Palette extensions and so much more! Stay tuned for v0.100!

❤️ PowerToys Community

The PowerToys team is extremely grateful to have the support of an amazing active community. The work you do is incredibly important. PowerToys wouldn't be nearly what it is today without your help filing bugs, updating documentation, guiding the design, or writing features. We want to say thank you and take time to recognize your work. Your contributions and feedback improve PowerToys month after month!

Contributing

This project welcomes contributions of all types. Besides coding features / bug fixes, other ways to assist include spec writing, design, documentation, and finding bugs. We are excited to work with the power user community to build a set of tools for helping you get the most out of Windows. We ask that before you start work on a feature that you would like to contribute, please read our Contributor's Guide. We would be happy to work with you to figure out the best approach, provide guidance and mentorship throughout feature development, and help avoid any wasted or duplicate effort. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you grant us the rights to use your contribution and that you have permission to do so. For guidance on developing for PowerToys, please read the developer docs for a detailed breakdown. This includes how to setup your computer to compile.

Code of conduct

This project has adopted the Microsoft Open Source Code of Conduct.

Privacy statement

The application logs basic diagnostic data (telemetry). For more privacy information and what we collect, see our PowerToys Data and Privacy documentation.

Description
Microsoft PowerToys is a collection of utilities that help you customize Windows and streamline everyday tasks
Readme MIT 742 MiB
Languages
C 44.9%
C# 26.4%
JavaScript 14%
C++ 13.8%
PowerShell 0.6%
Other 0.2%