Skip to content

Track and sync modifier states#57858

Merged
danielashare merged 1 commit intomasterfrom
danielashare/unstick-keys
Aug 20, 2025
Merged

Track and sync modifier states#57858
danielashare merged 1 commit intomasterfrom
danielashare/unstick-keys

Conversation

@danielashare
Copy link
Copy Markdown
Contributor

We're seeing issues where keys are getting stuck on remote desktop sessions when users use host OS shortcuts, most commonly Cmd+Shift+[3|4|5] to take a screenshot on MacOS. This is happening because when MacOS takes focus away from the browser, it doesn't send any key up events. The browser also doesn't detect focus out or blur events.

To fix this, I track the remote state of modifier keys in the InputHandler. When a key is pressed, the local modifiers are compared to the remote modifiers. If there's a difference in state, the remote modifiers are updated before sending the original key.

Closes: #54725, #53075

changelog: Prevent modifier keys from getting stuck during remote desktop sessions

Comment thread web/packages/shared/components/DesktopSession/InputHandler.tsx
Comment thread web/packages/shared/components/DesktopSession/InputHandler.tsx
Comment thread web/packages/shared/components/DesktopSession/InputHandler.tsx
@danielashare danielashare force-pushed the danielashare/unstick-keys branch 3 times, most recently from a81aea1 to 636f4da Compare August 14, 2025 15:56
Copy link
Copy Markdown
Member

@ravicious ravicious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, it works correctly now!

Comment thread web/packages/shared/components/DesktopSession/InputHandler.tsx Outdated
@danielashare danielashare force-pushed the danielashare/unstick-keys branch from 636f4da to c32dc35 Compare August 15, 2025 08:50
@danielashare danielashare force-pushed the danielashare/unstick-keys branch from c32dc35 to 77599b1 Compare August 15, 2025 08:51
@danielashare danielashare added this pull request to the merge queue Aug 20, 2025
Merged via the queue into master with commit 56d9b61 Aug 20, 2025
40 checks passed
@danielashare danielashare deleted the danielashare/unstick-keys branch August 20, 2025 07:48
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@danielashare See the table below for backport results.

Branch Result
branch/v16 Create PR
branch/v17 Create PR
branch/v18 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows RDP SHIFT+CMD/WINDOWS key stickness

3 participants