mike-jumper commented on code in PR #1195:
URL: https://github.com/apache/guacamole-client/pull/1195#discussion_r3025865130


##########
guacamole-common-js/src/main/webapp/modules/Keyboard.js:
##########
@@ -1339,6 +1339,13 @@ Guacamole.Keyboard = function Keyboard(element) {
         if (!guac_keyboard.modifiers.ctrl || !guac_keyboard.modifiers.alt)
             return;
 
+        // Do not release Ctrl+Alt when AltGr is genuinely held. On Windows,
+        // the browser sends a synthetic Left Ctrl before AltGraph. RDP
+        // targets require both Ctrl and Alt scancodes to remain active for
+        // AltGr character resolution.
+        if (guac_keyboard.pressed[0xFE03] || guac_keyboard.pressed[0xFFEA])
+            return;

Review Comment:
   I'm not sure about this. It's true that Windows emulates AltGr with 
Ctrl+Alt, but:
   
   * Windows also accepts the dedicated AltGr key, which the RDP support 
already sends.
   * If RDP servers in general do require different key events for AltGr, 
continuing to represent AltGr as AltGr within the Guacamole protocol is still 
the correct thing to do, as it preserves fidelity of user intent. It's the RDP 
support itself that should make any necessary protocol- or platform-specific 
translations.
   
   The proposed logic would also mean that the:
   
   ```c
   guac_keyboard.release(0xFFE3); // Left ctrl
   ...
   guac_keyboard.release(0xFFEA); // Right alt
   ```
   
   lines later on in this function will never have any effect (as the only way 
these lines will be reached is if neither of these keys are pressed).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to