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 ||
$scope.client.mouse.currentState.right)) 
                {
                    client.sendKeyEvent(1, keysym);
                    event.preventDefault();
                }
});

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?

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to