From 9e938be878bd9145f452d865798c1b99ed77f36f Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 14 Jun 2023 21:27:49 +0000 Subject: [PATCH 1/2] GUACAMOLE-1113: Restore right alt in keyboard handler. --- guacamole-common-js/src/main/webapp/modules/Keyboard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js index 0d7155a3c..a5792a005 100644 --- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js +++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js @@ -395,7 +395,7 @@ Guacamole.Keyboard = function Keyboard(element) { 13: [0xFF0D], // enter 16: [0xFFE1, 0xFFE1, 0xFFE2], // shift 17: [0xFFE3, 0xFFE3, 0xFFE4], // ctrl - 18: [0xFFE9, 0xFFE9, 0xFE03], // alt + 18: [0xFFE9, 0xFFE9, 0xFFEA], // alt 19: [0xFF13], // pause/break 20: [0xFFE5], // caps lock 27: [0xFF1B], // escape @@ -456,7 +456,7 @@ Guacamole.Keyboard = function Keyboard(element) { "Again": [0xFF66], "AllCandidates": [0xFF3D], "Alphanumeric": [0xFF30], - "Alt": [0xFFE9, 0xFFE9, 0xFE03], + "Alt": [0xFFE9, 0xFFE9, 0xFFEA], "Attn": [0xFD0E], "AltGraph": [0xFE03], "ArrowDown": [0xFF54], From 1f8183357cb1e628a368184c910ba4116275d6bb Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 14 Jun 2023 23:19:44 +0000 Subject: [PATCH 2/2] GUACAMOLE-1113: Always treat alt as AltGr on Mac. --- guacamole-common-js/src/main/webapp/modules/Keyboard.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js index a5792a005..62d709cb9 100644 --- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js +++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js @@ -295,6 +295,10 @@ Guacamole.Keyboard = function Keyboard(element) { // Determine whether default action for Alt+combinations must be prevented var prevent_alt = !this.modifiers.ctrl && !quirks.altIsTypableOnly; + // If alt is typeable only, and this is actually an alt key event, treat as AltGr instead + if (quirks.altIsTypableOnly && (this.keysym === 0xFFE9 || this.keysym === 0xFFEA)) + this.keysym = 0xFE03; + // Determine whether default action for Ctrl+combinations must be prevented var prevent_ctrl = !this.modifiers.alt;