[go: nahoru, domu]

Skip to content

Commit

Permalink
Keep the virtual keyboard after using extra keys
Browse files Browse the repository at this point in the history
If using the extra keys always gives focus to the screen then an
on-screen keyboard would be closed. When using on-screen keyboards we
instead want to give focus to our virtual keyboard input element.
  • Loading branch information
samhed committed Oct 31, 2019
1 parent 8c51e9a commit 94a01b0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions app/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1552,9 +1552,19 @@ const UI = {

sendKey(keysym, code, down) {
UI.rfb.sendKey(keysym, code, down);
// move focus to the screen in order to be able to
// use the keyboard right after these extra keys
UI.rfb.focus();

// Move focus to the screen in order to be able to use the
// keyboard right after these extra keys.
// The exception is when a virtual keyboard is used, because
// if we focus the screen the virtual keyboard would be closed.
// In this case we focus our special virtual keyboard input
// element instead.
if (document.getElementById('noVNC_keyboard_button')
.classList.contains("noVNC_selected")) {
document.getElementById('noVNC_keyboardinput').focus();
} else {
UI.rfb.focus();
}
// fade out the controlbar to highlight that
// the focus has been moved to the screen
UI.idleControlbar();
Expand Down

0 comments on commit 94a01b0

Please sign in to comment.