Github user mike-jumper commented on a diff in the pull request:

    https://github.com/apache/guacamole-client/pull/227#discussion_r161618151
  
    --- 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 --
    
    This particular one shouldn't have any impact, as it's actually just a 
refactored approach to the same behavior handled previously:
    
    
https://github.com/apache/guacamole-client/blob/c4ba495cca96f9823742083a8ecbaafb6be3c704/guacamole-common-js/src/main/webapp/modules/Keyboard.js#L187-L189
    
    vs.
    
    
https://github.com/apache/guacamole-client/blob/960e83f780425d93bf064f0187fd481cb848b150/guacamole-common-js/src/main/webapp/modules/Keyboard.js#L241-L242
    
    The other `keyupUnreliable` quirk for iOS might impact keyboard shortcuts 
in general, though. I'll retest.


---

Reply via email to