From 91645e29563eed1e903578aa282eb978f2a8a258 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Tue, 30 Jan 2024 20:19:00 +0000 Subject: [PATCH] GUACAMOLE-1904: Broadcast events for mouse/touch events in client. --- .../frontend/src/app/client/directives/guacClient.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/guacamole/src/main/frontend/src/app/client/directives/guacClient.js b/guacamole/src/main/frontend/src/app/client/directives/guacClient.js index fb88f99f5e..4ecd160dd8 100644 --- a/guacamole/src/main/frontend/src/app/client/directives/guacClient.js +++ b/guacamole/src/main/frontend/src/app/client/directives/guacClient.js @@ -54,6 +54,7 @@ angular.module('client').directive('guacClient', [function guacClient() { const ManagedClient = $injector.get('ManagedClient'); // Required services + const $rootScope = $injector.get('$rootScope'); const $window = $injector.get('$window'); /** @@ -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); + }; /** @@ -248,6 +252,9 @@ angular.module('client').directive('guacClient', [function guacClient() { scrollToMouse(event.state); client.sendMouseState(event.state, true); + // Broadcast the mouse event + $rootScope.$broadcast('guacClientMouseEvent', event); + }; /** @@ -269,6 +276,9 @@ angular.module('client').directive('guacClient', [function guacClient() { display.showCursor(false); client.sendTouchState(event.state, true); + // Broadcast the touch event + $rootScope.$broadcast('guacClientTouchEvent', event); + }; // Attach any given managed client