You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@guacamole.apache.org by "Mike Jumper (Jira)" <ji...@apache.org> on 2019/10/07 15:27:00 UTC
[jira] [Commented] (GUACAMOLE-892) Ctrl+Alt+Shift menu call is
incompatible with Alt+Shift keyboard layout swith on Linux
[ https://issues.apache.org/jira/browse/GUACAMOLE-892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16945960#comment-16945960 ]
Mike Jumper commented on GUACAMOLE-892:
---------------------------------------
I don't think checking {{code}} is the route that should be taken, as that property disregards the true identity of the key as dictated by the local keyboard layout. If the Shift or Alt keypress is not actually Shift or Alt according to the OS, then we shouldn't interpret it as such.
As far as allowing the menu to open, I would lean more toward adding Ctrl+Alt+GroupNext and Ctrl+Shift+GroupNext as alternative shortcuts for opening the menu. Looking into some other key sequence that doesn't involve Alt and Shift would be another option. If Alt+Shift is being reserved by the OS to switch keyboard layouts, even while Ctrl is held down, altering things such that Alt+Shift continues to be recognized for the sake of the menu could lead to confusion, as the keyboard layout would still be mysteriously switched.
> Ctrl+Alt+Shift menu call is incompatible with Alt+Shift keyboard layout swith on Linux
> --------------------------------------------------------------------------------------
>
> Key: GUACAMOLE-892
> URL: https://issues.apache.org/jira/browse/GUACAMOLE-892
> Project: Guacamole
> Issue Type: Bug
> Components: guacamole-client
> Affects Versions: 1.0.0
> Environment: Ubuntu 18.04.3 LTS
> Firefox 70.0b2 and Chrome 77.0.3865.90
> Reporter: Andrey Doronin
> Priority: Major
>
> The problem is that on Linux in case of such key-combo we receive {{"GroupNext"}} key instaead of "Shift".
> In Firefox the keydown event looks like this:
> {code:java}
> keydown Alt-Control
> altKey: true
> bubbles: true
> cancelBubble: false
> cancelable: true
> charCode: 0
> code: "ShiftLeft"
> composed: true
> ctrlKey: true
> currentTarget: null
> defaultPrevented: false
> detail: 0
> eventPhase: 0
> explicitOriginalTarget: <body>
> isComposing: false
> isTrusted: true
> key: "GroupNext"
> keyCode: 16
> layerX: 0
> layerY: 0
> location: 0
> metaKey: false
> originalTarget: <body>
> rangeOffset: 0
> rangeParent: null
> repeat: false
> returnValue: true
> shiftKey: false
> srcElement: <body>
> target: <body>
> timeStamp: 2320832
> type: "keydown"
> view: Window about:blank
> which: 16
> <get isTrusted()>: function isTrusted()
> <prototype>: KeyboardEventPrototype { getModifierState: getModifierState(), initKeyboardEvent: initKeyboardEvent(), initKeyEvent: initKeyEvent(), ... }{code}
> So I guess the most easy way to fix it could be to change the order here [https://github.com/apache/guacamole-client/blob/9d485ffcf755e88cccf9a7aadc72911633277117/guacamole-common-js/src/main/webapp/modules/Keyboard.js#L249]
> in the same way as in KeyupEvent.
> But unfortunately in Chrome we get keyCode == 0
> {code:java}
> KeyboardEvent {isTrusted: true, key: "GroupNext", code: "ShiftLeft", location: 1, ctrlKey: true, ...}
> altKey: true
> bubbles: true
> cancelBubble: false
> cancelable: true
> charCode: 0
> code: "ShiftLeft"
> composed: true
> ctrlKey: true
> currentTarget: null
> defaultPrevented: false
> detail: 0
> eventPhase: 0
> isComposing: false
> isTrusted: true
> key: "GroupNext"
> keyCode: 0
> location: 1
> metaKey: false
> path: (4) [body.light-chip.inited, html, document, Window]
> repeat: false
> returnValue: true
> shiftKey: false
> sourceCapabilities: InputDeviceCapabilities {firesTouchEvents: false}
> srcElement: body.light-chip.inited
> target: body.light-chip.inited
> timeStamp: 9475.445000000036
> type: "keydown"
> view: Window {parent: Window, postMessage: ƒ, blur: ƒ, focus: ƒ, close: ƒ, ...}
> which: 0
> __proto__: KeyboardEvent
> {code}
> So it looks like the only way to guess the real Shift key is event.code.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)