Github user necouchman commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/227#discussion_r161811586
--- Diff: guacamole-common-js/src/main/webapp/modules/Keyboard.js ---
@@ -55,6 +55,47 @@ Guacamole.Keyboard = function(element) {
*/
this.onkeyup = null;
+ /**
+ * Set of known platform-specific or browser-specific quirks which
must be
+ * accounted for to properly interpret key events, even if the only
way to
+ * reliably detect that quirk is to platform/browser-sniff.
+ *
+ * @private
+ * @type {Object.<String, Boolean>}
+ */
+ var quirks = {
+
+ /**
+ * Whether keyup events are universally unreliable.
+ *
+ * @type {Boolean}
+ */
+ keyupUnreliable: false,
+
+ /**
+ * Whether the Alt key is actually a modifier for typable keys and
is
+ * thus never used for keyboard shortcuts.
+ *
+ * @type {Boolean}
+ */
+ altIsTypableOnly: false
+
+ };
+
+ // Set quirk flags depending on platform/browser, if such information
is
+ // available
+ if (navigator && navigator.platform) {
+
+ // All keyup events are unreliable on iOS (sadly)
+ if (navigator.platform.match(/ipad|iphone|ipod/i))
+ quirks.keyupUnreliable = true;
+
+ // The Alt key on Mac is never used for keyboard shortcuts
+ else if (navigator.platform.match(/^mac/i))
+ quirks.altIsTypableOnly = true;
+
--- End diff --
:+1:
---