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

    https://github.com/apache/guacamole-client/pull/227#discussion_r161620053
  
    --- 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 --
    
    Apparently, keydown for modifier keys on iOS is not currently properly 
handled (the key identity is missing from the event), but the tracking of 
modifier state used `Guacamole.Keyboard` to automatically release modifiers can 
be used to also properly press them, and things should then work as expected.
    
    I'll make the necessary change.


---

Reply via email to