Fix modifier keys being toggled when typing extended keys like arrows (#731)
* Fix modifier keys being toggled when typing extended keys like arrows When sending keys via virtual key code, the KEYEVENTF_EXTENDEDKEY flag was never set. Without this flag, Windows treats navigation keys (arrows, Home, End, etc.) as numpad keys. Due to legacy numpad handling, Windows internally injects fake modifier key-up/key-down events around numpad keystrokes when a modifier is held, which causes the modifier state to be toggled. This broke scenarios like Shift+Arrow for text selection. Set KEYEVENTF_EXTENDEDKEY for known extended keys when sending via virtual key code, matching how the scan code path already handles this. Fixes #295 * Add test for text selection using Shift+Arrow via Keyboard.Pressing Uses the repo's test applications (WinForms/WPF) to verify that Pressing(LSHIFT) with arrow keys correctly selects text. Asserts by typing over the selection and checking the resulting text. Verifies the fix for #295. * Update src/FlaUI.Core/Input/Keyboard.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/FlaUI.Core/Input/Keyboard.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Roman <r.baeriswyl@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
T
Tom Beech committed
296ad2ba2e4455a2b8c430834ab691c8ca08167d
Parent: f1cd3a3
Committed by GitHub <noreply@github.com>
on 3/27/2026, 10:31:42 PM