bbennett-ks commented on code in PR #1164:
URL: https://github.com/apache/guacamole-client/pull/1164#discussion_r2830256599
##########
guacamole-common-js/src/main/webapp/modules/Touch.js:
##########
@@ -336,6 +336,24 @@ Guacamole.Touch.Event = function TouchEvent(type, event,
state) {
Guacamole.Event.DOMEvent.call(this, type, [ event ]);
+ /**
+ * The state of all modifier keys at the time this event was received.
+ * If the original DOM event is not a TouchEvent or modifier state is
+ * otherwise unavailable, the state of all modifiers will be false.
+ *
+ * @type {!Guacamole.Keyboard.ModifierState}
+ */
+ this.modifiers = (function getTouchModifierState() {
+
+ // Guard against Keyboard.js not being available/loaded yet.
+ if (!Guacamole.Keyboard || !Guacamole.Keyboard.ModifierState
+ || !Guacamole.Keyboard.ModifierState.fromTouchEvent)
+ return new Guacamole.Keyboard.ModifierState();
Review Comment:
Notice I missed !event.
Am I going overboard with the guards?
--
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]