mike-jumper commented on code in PR #1176:
URL: https://github.com/apache/guacamole-client/pull/1176#discussion_r3026397373
##########
guacamole-common-js/src/main/webapp/modules/OnScreenKeyboard.js:
##########
@@ -58,6 +58,23 @@ Guacamole.OnScreenKeyboard = function(layout) {
*/
var pressed = {};
+ /**
+ * Returns if the given keysym is a lock key (Caps Lock,
+ * Num Lock, or Scroll Lock).
+ *
+ * @private
+ * @param {!number} keysym
+ * The keysym to test.
+ *
+ * @returns {!boolean}
+ * true if the keysym is a lock key, false otherwise.
+ */
+ var isToggleLockKeysym = function isToggleLockKeysym(keysym) {
+ return keysym === 0xFFE5 // Caps Lock
+ || keysym === 0xFF7F // Num Lock
+ || keysym === 0xFF14; // Scroll Lock
Review Comment:
The on-screen keyboard implementation intentionally avoids making any
assumptions about how the keys that send particular keysyms behave, relying
instead on the JSON describing the layout to define this:
https://github.com/apache/guacamole-client/blob/4245fbb7e2224e43141e4e5833647a38988edd0b/guacamole/src/main/frontend/src/layouts/en-us-qwerty.json#L55-L94
Keeping with that pattern, I don't think we should do this here. We should
instead allow the JSON to define whether a modifier is a toggle modifier.
--
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]