sschiffli commented on code in PR #1155:
URL: https://github.com/apache/guacamole-client/pull/1155#discussion_r2818520356
##########
guacamole-common-js/src/main/webapp/modules/Mouse.js:
##########
@@ -510,6 +510,81 @@ Guacamole.Mouse.State.Buttons = {
};
+/**
+ * The state of all supported keyboard modifiers. This is the same structure
+ * used for keyboard modifier state tracking.
+ * @constructor
+ */
+Guacamole.Mouse.ModifierState = function() {
+
+ /**
+ * Whether shift is currently pressed.
+ *
+ * @type {!boolean}
+ */
+ this.shift = false;
+
+ /**
+ * Whether ctrl is currently pressed.
+ *
+ * @type {!boolean}
+ */
+ this.ctrl = false;
+
+ /**
+ * Whether alt is currently pressed.
+ *
+ * @type {!boolean}
+ */
+ this.alt = false;
+
+ /**
+ * Whether meta (apple key) is currently pressed.
+ *
+ * @type {!boolean}
+ */
+ this.meta = false;
+
+ /**
+ * Whether hyper (windows key) is currently pressed.
+ *
+ * @type {!boolean}
+ */
+ this.hyper = false;
+
+};
+
+/**
+ * Returns the modifier state applicable to the mouse event given.
+ *
+ * @param {!MouseEvent} e
+ * The mouse event to read.
+ *
+ * @returns {!Guacamole.Mouse.ModifierState}
+ * The current state of keyboard modifiers.
+ */
+Guacamole.Mouse.ModifierState.fromMouseEvent = function(e) {
Review Comment:
I considered this as well, I originally opted for duplication since
MouseEvent and KeyboardEvent didn't share any common base class, but
practically speaking this does feel a bit unnecessary.
--
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]