You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by "mike-jumper (via GitHub)" <gi...@apache.org> on 2024/01/31 18:35:22 UTC
Re: [PR] GUACAMOLE-1904: Broadcast events for mouse/touch events in client. [guacamole-client]
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: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org