mike-jumper commented on code in PR #950:
URL: https://github.com/apache/guacamole-client/pull/950#discussion_r1473286825


##########
guacamole/src/main/frontend/src/app/client/directives/guacClient.js:
##########
@@ -220,6 +221,9 @@ angular.module('client').directive('guacClient', [function 
guacClient() {
             display.showCursor(!localCursor);
             client.sendMouseState(event.state, true);
 
+            // Broadcast the mouse event
+            $rootScope.$broadcast('guacClientMouseEvent', event);

Review Comment:
   For these events to provide context for whatever handles those events, 
they'll need some kind of reference to the client that would receive the event.



##########
guacamole/src/main/frontend/src/app/client/directives/guacClient.js:
##########
@@ -220,6 +221,9 @@ angular.module('client').directive('guacClient', [function 
guacClient() {
             display.showCursor(!localCursor);
             client.sendMouseState(event.state, true);
 
+            // Broadcast the mouse event
+            $rootScope.$broadcast('guacClientMouseEvent', event);

Review Comment:
   I think these events should be renamed in line with other established events:
   * Omit the redundant "Event" from the name of the event.
   * Split into the types of events recognized by the objects firing them 
(`guacClientMouseDown`, `guacClientMouseUp`, etc.) so that the handler of these 
events can have that context without needing to implement their own state 
tracking, similar to the established `guacKeyDown` and `guacKeyUp`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to