From user-return-4378-archive-asf-public=cust-asf.ponee.io@guacamole.apache.org Fri Aug 17 02:55:08 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C74D3180675 for ; Fri, 17 Aug 2018 02:55:07 +0200 (CEST) Received: (qmail 90021 invoked by uid 500); 17 Aug 2018 00:55:06 -0000 Mailing-List: contact user-help@guacamole.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@guacamole.apache.org Delivered-To: mailing list user@guacamole.apache.org Received: (qmail 90012 invoked by uid 99); 17 Aug 2018 00:55:06 -0000 Received: from mail-relay.apache.org (HELO mailrelay1-lw-us.apache.org) (207.244.88.152) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2018 00:55:06 +0000 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by mailrelay1-lw-us.apache.org (ASF Mail Server at mailrelay1-lw-us.apache.org) with ESMTPSA id 9A97B4EEF for ; Fri, 17 Aug 2018 00:55:05 +0000 (UTC) Received: by mail-lf1-f45.google.com with SMTP id j8-v6so4732014lfb.4 for ; Thu, 16 Aug 2018 17:55:05 -0700 (PDT) X-Gm-Message-State: AOUpUlF/t3A2kIHOq9IhBIguvzsMacgh12xZF4brpBq+xGuOujsoQIxs JjRfbrsUjSp3XrRZxtGzx/gJ+vPe77w4RiD50Mg= X-Google-Smtp-Source: AA+uWPwqabCsI1qYFbeN6ntDkqfImuX6aeDSKUq1IJuhpXyx+7hNDOtHzEoaeIC62XokfgsoIMKWPb3nAEW6gH2zG80= X-Received: by 2002:a19:ec04:: with SMTP id b4-v6mr21229649lfa.91.1534467304328; Thu, 16 Aug 2018 17:55:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nick Couchman Date: Thu, 16 Aug 2018 20:54:53 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: programmatically open guacamole menu To: user@guacamole.apache.org Content-Type: multipart/alternative; boundary="0000000000009813ae0573970261" --0000000000009813ae0573970261 Content-Type: text/plain; charset="UTF-8" On Thu, Aug 16, 2018 at 8:31 PM Yi Sun wrote: > Thanks for the help, Nick, at this time I'm still exploring guacamole.js > and Keyboard.js to see how to send ctrl+shif+alt event to Guacamole. > > In my code I just tried to create an Guacamole.Keyboard and set > modifierstate but that does not work for me.. > > var state =new Guacamole.Keyboard.ModifierState(); > kb.modifiers.alt=true; > kb.modifiers.ctrl=true; > kb.modifiers.shift=true; > I don't think that setting this will actually make the JavaScript application recognize a keypress. This would more likely send those modifiers through to the client, but not actually trigger it. However, if you're trying to create a button to trigger the menu, I wouldn't worry about emulating the Ctrl-Alt-Shift keypress - you should be able to create a method that opens the menu similar to the one that does it when those keys are pressed. If you look at the clientController.js file around these lines: https://github.com/apache/guacamole-client/blob/7d822df5a3b040bf61d1055fe7bffaf1996c0983/guacamole/src/main/webapp/app/client/controllers/clientController.js#L544-L547 You'll see the code block that is called when the client controller detects the Ctrl-Shift-Alt key-combo - you should be able to create a method that can be called by your button that does something similar to this. -Nick > --0000000000009813ae0573970261 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu= , Aug 16, 2018 at 8:31 PM Yi Sun <y.= sun5@uq.edu.au> wrote:
Thanks for the help, Nick, at this time I'm still exploring guacam= ole.js and Keyboard.js to see how to send ctrl+shif+alt event to Guacamole.=

In my code I just tried to create an Guacamole.Keyboard and set modifi= erstate but that does not work for me..

var state =3Dnew Guacamole.Keyboard.ModifierState();
kb.modifiers.alt=3Dtrue;
kb.modifiers.ctrl=3Dtrue;
kb.modifiers.shift=3Dtrue;=C2=A0=C2=A0
I don't think that setting this will actually make the Jav= aScript application recognize a keypress.=C2=A0 This would more likely send= those modifiers through to the client, but not actually trigger it.
<= div>
However, if you're trying to create a button to trig= ger the menu, I wouldn't worry about emulating the Ctrl-Alt-Shift keypr= ess - you should be able to create a method that opens the menu similar to = the one that does it when those keys are pressed.=C2=A0 If you look at the = clientController.js file around these lines:


=C2=A0
You'll see the code block that is called when the client contr= oller detects the Ctrl-Shift-Alt key-combo - you should be able to create a= method that can be called by your button that does something similar to th= is.

-Nick
--0000000000009813ae0573970261--