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

Long hold ESC to exit full screen in the web interface does not work in certain cases and many key combinations leak to the client OS #107

Closed
ehfd opened this issue Oct 12, 2023 · 10 comments
Labels
bug Something isn't working web Web components including gst-web

Comments

@ehfd
Copy link
Member

ehfd commented Oct 12, 2023

Behavior reproduced in Chromium (Chrome, Edge) and Firefox.

Issue 1:

When the "Enter full screen" button is pressed in the side menu, it is supposed to turn into a mode where a press and hold on ESC is required to exit the full screen.

Expected behavior:
image

Actual behavior:
image

The expected behavior only happens when Ctrl+Shift+F is pressed in Chromium.

Press and hold ESC to exit does not work in Firefox even if Ctrl+Shift+F is pressed.

Issue 2:

Edit: Turns out the only thing that didn't work when the "Enter full screen" button wasn't the "Press and hold ESC" issue.
An additional critical issue is that relative cursors also don't work correctly. It works when using Ctrl+Shift+F, but not when using the "Enter full screen" button in the menu panel.

Issue 3:

Moreover, even when the expected behavior with Ctrl+Shift+F is triggered, certain keyboard button combinations are passed to the client, instead of the remote host.

For example, in touchpads, a three-finger tap should be equal to clicking the middle mouse button. Instead, it triggers the start menu in the Windows client.

I understand that the browser has limitations on what keys can be captured by the browser and which will be sent to the client, but Guacamole's Tomcat HTML5 client supports many more keys to be passed to the remote host than what we do now.

Issue 4:
Users don't know that there is a Ctrl+Shift+F and Ctrl+Shift+LtClick shortcut. It would be useful to add information of all shortcuts in the menu.

@ehfd ehfd added bug Something isn't working web Web components including gst-web labels Oct 12, 2023
@ehfd ehfd changed the title Long press ESC to exit full screen in the web interface does not work in certain cases, and many key combinations leak to the client OS Long hold ESC to exit full screen in the web interface does not work in certain cases, and many key combinations leak to the client OS Oct 13, 2023
@ehfd ehfd changed the title Long hold ESC to exit full screen in the web interface does not work in certain cases, and many key combinations leak to the client OS Long hold ESC to exit full screen in the web interface does not work in certain cases, relative cursor doesn't work, and many key combinations leak to the client OS Oct 15, 2023
@ehfd ehfd added the high-priority Must be addressed as soon as possible, remove when resolved label Oct 15, 2023
@ehfd
Copy link
Member Author

ehfd commented Oct 15, 2023

This turns out to be an urgent bug, restricting capabilities in a major way.

@danisla

@ehfd
Copy link
Member Author

ehfd commented Oct 19, 2023

Issue 1 and 2: _onFullscreenChange of input.js is not triggered when triggering enterFullscreen of app.js by pressing the Enter fullscreen mode (CTRL+SHIFT+F) button.

Issue 3: Add additional keys to:

/**
* Request keyboard lock, must be in fullscreen mode to work.
*/
requestKeyboardLock() {
// event codes: https://www.w3.org/TR/uievents-code/#key-alphanumeric-writing-system
const keys = [
"AltLeft",
"AltRight",
"Tab",
"Escape",
"ContextMenu",
"MetaLeft",
"MetaRight"
];
console.log("requesting keyboard lock");
navigator.keyboard.lock(keys).then(
() => {
console.log("keyboard lock success");
}
).catch(
(e) => {
console.log("keyboard lock failed: ", e);
}
)
}

@danisla
Copy link
Member

danisla commented Oct 20, 2023

To clarify on how the browser works, there are two kinds of full screen behavior:

  1. A JavaScript full screen action initiated via the Fullscreen API, this gives the short "Press ESC to exit full screen" message.
  2. A JavaScript full screen session with Keyboard Lock, same as 1. but with the addition of the keyboard lock function, when in this mode, you see the 'Press and hold ESC to exit full screen". Only in this mode can some additional keyboard and mouse actions be trapped and sent to the remote session, like the ESC key...

I think what you are asking for is to have the CTRL+SHIFT+F behavior match the "Fullscreen" button on the side panel? correct?

And when either action is triggered this should the expected behavior:

  1. full keyboard lock
  2. relative mouse mode enabled
  3. pass additional (what exactly?) keys to the keyboard lock mode.
  4. Have the behavior work exactly the same on Chrome and Firefox.

Is that everything?

@ehfd
Copy link
Member Author

ehfd commented Oct 20, 2023

I think what you are asking for is to have the CTRL+SHIFT+F behavior match the "Fullscreen" button on the side panel? correct?

Opposite. That the "Fullscreen" button match the CTRL+SHIFT+F behavior.

  1. full keyboard lock
  2. relative mouse mode enabled
  3. pass additional (what exactly?) keys to the keyboard lock mode.
  4. Have the behavior work exactly the same on Chrome and Firefox.

We need to solve 1 and 2 for now. Then the urgent tag goes away. I'll analyze more about number 3.

@ehfd
Copy link
Member Author

ehfd commented Oct 20, 2023

I think number 3 is a false alarm. It was a configuration aspect from Windows, not Selkies.

A button to pass Ctrl+Alt+Del (Like how Guacamole does) would be useful though, because it would not be possible elsewise.

@ehfd
Copy link
Member Author

ehfd commented Oct 21, 2023

Seemingly, the fullscreen button WORKS in v1.3.8. I tested it in v1.3.8 and that is the case.

CC @xhejtman

I can reproduce the similarities between v1.3.8 (18.04-legacy) and now. I have also confirmed that no relevant code was changed between then and now.
https://github.com/selkies-project/selkies-gstreamer/compare/v1.3.8..v1.5.1

After a Ctrl + Shift + F and then long hold ESC (the first time fullscreen is activated), both Ctrl + Shift + F and the Fullscreen button work as intended.

This means that when something is done, the long hold ESC operation is preserved in subsequent button clicks (and we can start being creative about that).

But without the first Ctrl + Shift + F and then long hold ESC, the Fullscreen button doesn't work correctly.

Perhaps, could we use the "Start" button (since it's needed anyways) to make it pass an operation in conjunction to solve this Fullscreen button issue? @danisla

@xhejtman
Copy link
Contributor

For me, the Fullscreen button does not work even if Ctrl + Shift + F is the first thing. The Ctrl + Shift + F works ok though.

@ehfd
Copy link
Member Author

ehfd commented Oct 25, 2023

I have went far as v1.1.2 and the behavior is the same or becomes worse (e.g. long press ESC is activated but remote cursor is not). Possibly affected by browser-side changes.

@ehfd
Copy link
Member Author

ehfd commented Nov 6, 2023

Comparison with noVNC, KasmVNC, Guacamole, etc. on the same behavior is required. A possible solution may be found.

@ehfd ehfd mentioned this issue Mar 24, 2024
1 task
@ehfd ehfd changed the title Long hold ESC to exit full screen in the web interface does not work in certain cases, relative cursor doesn't work, and many key combinations leak to the client OS Long hold ESC to exit full screen in the web interface does not work in certain cases and many key combinations leak to the client OS Apr 11, 2024
@ehfd ehfd closed this as completed in c286390 Jun 6, 2024
@ehfd ehfd removed the high-priority Must be addressed as soon as possible, remove when resolved label Jun 6, 2024
@ehfd
Copy link
Member Author

ehfd commented Jun 6, 2024

Fixed in c286390.

There's still a small issue where the keystrokes while inside the menu still get passed into the remote desktop, but petty compared to the issue that was before.

@ehfd ehfd unassigned danisla Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working web Web components including gst-web
Projects
None yet
Development

No branches or pull requests

3 participants