Fix: KeyDown repeats while key is held down (not just KeyPress)#2226
Fix: KeyDown repeats while key is held down (not just KeyPress)#2226
Conversation
Agent-Logs-Url: https://github.com/dotnet/docs-desktop/sessions/fd0f091e-d985-49dd-8cc4-aad9298c846d Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/docs-desktop/sessions/fd0f091e-d985-49dd-8cc4-aad9298c846d Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
|
@copilot events are raised, they don't "occur" .. change that back |
Agent-Logs-Url: https://github.com/dotnet/docs-desktop/sessions/91f3b17f-cb63-4654-a014-89a17bd98f73 Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR corrects the Windows Forms keyboard input documentation to accurately describe that both KeyDown and KeyPress can repeat at the OS key-repeat rate while a key is held, and that KeyUp fires once on release.
Changes:
- Updated the keyboard event order sequence to show that both
KeyDownandKeyPressrepeat while a key is held. - Clarified
KeyDownrepeat behavior in the keyboard events overview and reference tables. - Updated the control authoring input table to reflect
KeyDownrepeat behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
dotnet-desktop-guide/winforms/input-keyboard/overview.md |
Fixes the “order of keyboard events” sequence to show both KeyDown and KeyPress repeating while held. |
dotnet-desktop-guide/winforms/input-keyboard/events.md |
Updates KeyDown behavior description, refreshes frontmatter, and adjusts keyboard event table wording. |
dotnet-desktop-guide/winforms/controls/handling-user-input.md |
Corrects the KeyDown row description to reflect repeat behavior while held. |
|
@copilot let's clean up |
…e and KeyUp xref Agent-Logs-Url: https://github.com/dotnet/docs-desktop/sessions/c34c224d-b0fe-4b3c-8cb2-2e4f6e165950 Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Done in commit 9585953. Replaced the table with three subsections (KeyDown, KeyPress, KeyUp), each leading with a description paragraph followed by bullet points. Also fixed the Caps Lock character code (65, not 97) and the incorrect |
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Docs incorrectly stated that
KeyDownfires only once per keypress. In reality, bothKeyDownandKeyPressfire repeatedly at the OS repeat rate while a key is held—KeyUpis the only event that fires exactly once.Changes
events.md— Fixed bullet stating "The KeyDown event occurs once"; updated table description to clarify repeat behavior; full style-guide edit pass; date updated to 04/20/2026.overview.md— Rewrote the "Order of keyboard events" sequence, which previously implied onlyKeyPressrepeats on hold. Now correctly shows bothKeyDownandKeyPressfire on each key-repeat cycle.handling-user-input.md— FixedKeyDowntable row from "Raised only when a key is initially pressed" to reflect the repeat behavior.Internal previews