From 4f72d049d7033fdba5dadb9c89a45505b39c9d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Tue, 27 Jun 2023 23:37:41 +0200 Subject: [PATCH] GUACAMOLE-1823: Fix capslock on macos chrome --- guacamole-common-js/src/main/webapp/modules/Keyboard.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js index 62d709cb94..0619150185 100644 --- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js +++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js @@ -1362,6 +1362,15 @@ Guacamole.Keyboard = function Keyboard(element) { e.preventDefault(); + // 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 (e.keyCode == 20 && quirks.capsLockKeyupUnreliable) { + eventLog.push(new KeydownEvent(e)); + interpret_events(); + return; + } + // Log event, call for interpretation eventLog.push(new KeyupEvent(e)); interpret_events();