Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The System steals keyboard events for certain system keyboard shortcuts, e.g. Cmd+Shift+4 #1799

Open
namper opened this issue Aug 17, 2023 · 7 comments

Comments

@namper
Copy link

namper commented Aug 17, 2023

Describe the bug
The system steals keyboard events for certain system keyboard shortcuts, e.g. Cmd+Shift+4. Unfortunately, this isn't considered a focus loss, so the server doesn't realize it has lost a few keyboard events and can end up in a confused state.

To Reproduce
Steps to reproduce the behavior:
Press CMD+SHIFT+4
Take screenshot
Click on server and see that server is confused as you can't click but can only drag.

Expected behavior
noVNC should catch focus loss and reset keyboard state.

Screenshots
cced1247-88f4-4ddf-945b-1c314fb2ba51

Client (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • Browser version: 115.0.5790.170

Server (please complete the following information):

  • noVNC version: 1.4.0
  • VNC server: TigerVNC
  • WebSocket proxy: websockify

Additional context
Here is this exact problem solved by tigervnc TigerVNC/tigervnc@4f6d489

@CendioOssman
Copy link
Member

Unfortunately, we don't have access to the low-level events like TigerVNC has, so we can't apply the same workaround.

Likely this needs to be fixed in the browsers so that they send keyup events when this happens.

Have you reported the issue to the different browsers?

@namper
Copy link
Author

namper commented Aug 21, 2023

Thanks for reply. I am aware we can't access the low level API hack that TigerVNC is doing. Unfortunately, this bug is also reproducible on Safari & Mozilla. What would you advise as potential interim solution, for example detecting that Command and Shift is pressed and scheduling Command & Shift key down events to server.

Versions:
Safari: 16.5
Firefox: 107.0.1

@namper
Copy link
Author

namper commented Aug 21, 2023

I found similar issues attempted fix by KasmVNC's fork of noVNC will test this solution. kasmtech@2b7e332

@CendioOssman
Copy link
Member

Trying to perfectly detect every possible troublesome shortcut would be a maintenance nightmare. So what Kasm has done is probably a more feasible mitigation of the issue.

It's important that the issue get reported to all the browsers, though, so a proper solution can be available long term.

@namper
Copy link
Author

namper commented Aug 23, 2023

@CendioOssman
Copy link
Member

Many thanks. I don't suppose you could also inform Firefox and Safari (WebKit) of this issue?

@namper
Copy link
Author

namper commented Aug 29, 2023

Many thanks. I don't suppose you could also inform Firefox and Safari (WebKit) of this issue?

Likewise. Raised to all 3 of them.

WebKit: https://bugs.webkit.org/show_bug.cgi?id=260866
Mozila: https://bugzilla.mozilla.org/show_bug.cgi?id=1850583
Chromium: https://bugs.chromium.org/p/chromium/issues/detail?id=1474894#c3

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

No branches or pull requests

2 participants