From d42bdd33bef4af73e06ecf2e729340fc76f13820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Wed, 12 Jul 2023 22:41:36 +0200 Subject: [PATCH] GUACAMOLE-1823: Fix capslock on macos chrome. --- guacamole-common-js/src/main/webapp/modules/Keyboard.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js index 748cab3cc9..fa507ba191 100644 --- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js +++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js @@ -355,6 +355,14 @@ Guacamole.Keyboard = function Keyboard(element) { // We extend KeyEvent KeyEvent.call(this, orig); + // If unreliable caps lock was pressed and event was not marked, then + // we need to pretend that this is a keydown event because we obviously + // did not receive it (issue on macos with chrome) + if (this.keyCode == 20 && quirks.capsLockKeyupUnreliable) { + eventLog.push(new KeydownEvent(this)); + return; + } + // If key is known from keyCode or DOM3 alone, use that (keyCode is // still more reliable for keyup when dead keys are in use) this.keysym = keysym_from_keycode(this.keyCode, this.location)