guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Wolfheimer <>
Subject Re: Handling of simultaneous key-down and mouse-button events
Date Tue, 23 Oct 2018 20:19:19 GMT
Hi Mike

thanks a lot for your input. I thought a bit about it and it seems that
the heuristics which makes sense here is:

Use the keyboard behavior as is if no mouse button is pressed.
If a mouse button is pressed, don't send repeated key events while the
mouse button is pressed.

Many CAD programs use combined key-down + mouse button-down + mouse
move events to navigate in their 3D views, so I think that this
behavior makes sense for at least this class of applications. I looked
at the Guacamole.Keyboard as well as Guacamole.Mouse implementations.
As I'm not a Javascript programmer I'm not completely sure whether I
understand all of this stuff correctly, but it seems to me that I might
get the described behavior by changing a function 
in guacamole/src/main/webapp/app/client/directives/guacClient.js:

// Translate local keydown events to remote keydown events if keyboard
is enabled
$scope.$on('guacKeydown', function keydownListener(event, keysym,
keyboard) {
     if ($scope.client.clientProperties.keyboardEnabled &&
!event.defaultPrevented && 
                  !($scope.client.mouse.currentState.left ||
$scope.client.mouse.currentState.middle ||
                    client.sendKeyEvent(1, keysym);

The additional "!($scope.client.mouse.currentState.left ||
$scope.client.mouse.currentState.middle ||
$scope.client.mouse.currentState.right)" should tell the client to not
send repeated key-down events if any mouse button is clicked. Does this
sound right?

View raw message