fix(macos): preserve modifier state in input events#5102
Conversation
ddcad56 to
5e4c544
Compare
Bundle ReportBundle size has no change ✅ |
|
@martona thank you for the PR! Could you correct the lint error? |
|
Yup, for sure. I thought I would wait for all checks to complete before pushing changes. Already done on #5107 though. |
|
Done! |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5102 +/- ##
==========================================
- Coverage 17.86% 17.83% -0.04%
==========================================
Files 111 111
Lines 24005 24009 +4
Branches 10619 10620 +1
==========================================
- Hits 4289 4281 -8
- Misses 14579 15502 +923
+ Partials 5137 4226 -911
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 40 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|



Description
Fix macOS keyboard event handling so modifier state is preserved reliably across keyboard and mouse input.
macOS input handling was reusing a mutable
CGEventReffor keyboard events. That could leave stale event state behind and caused modifier combinations such as Shift+Enter or Cmd+Tab to be replayed inconsistently.This change creates fresh keyboard events for each input update:
CGEventCreate(...)event withkCGEventFlagsChanged.CGEventCreateKeyboardEvent(...)for key up/down events.Tested manually on macOS via Moonlight/Sunshine input replay:
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage