summaryrefslogtreecommitdiff
path: root/kvmd/web/js/mouse.js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-07-28 13:23:27 +0300
committerDevaev Maxim <[email protected]>2018-07-28 13:23:27 +0300
commit01e5a8caeeeba2772acf5f888278e891aea09608 (patch)
treecad2c19d5ff7a9f086b3078069c4e483bcbacde4 /kvmd/web/js/mouse.js
parentc3939214bf07742b2e5a5c27d89dcd42dc94cb4a (diff)
interactive hid leds
Diffstat (limited to 'kvmd/web/js/mouse.js')
-rw-r--r--kvmd/web/js/mouse.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/kvmd/web/js/mouse.js b/kvmd/web/js/mouse.js
index 0f2379fe..3195582c 100644
--- a/kvmd/web/js/mouse.js
+++ b/kvmd/web/js/mouse.js
@@ -14,10 +14,14 @@ var mouse = new function() {
};
this.setSocket = function(ws) {
- $("hid-mouse-led").className = (ws ? "led-on" : "led-off");
__ws = ws;
};
+ this.updateLeds = function() {
+ var focused = (__ws && document.activeElement === $("stream-window"));
+ $("hid-mouse-led").className = (focused ? "led-on" : "led-off");
+ };
+
var __buttonHandler = function(event, state) {
// https://www.w3schools.com/jsref/event_button.asp
switch (event.button) {