diff options
author | Maxim Devaev <[email protected]> | 2024-02-16 18:49:38 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2024-02-16 18:49:38 +0200 |
commit | 22140106c481e8f6d0a0bbb081e756fa9993ee3b (patch) | |
tree | 8bf10841a8c70db3448ba9b0020eabb29095b419 /web/share/js | |
parent | 9d33bb93ea03c3a5fe9271038fc5ab91fb871f62 (diff) |
web: Option to hide blue dot
Diffstat (limited to 'web/share/js')
-rw-r--r-- | web/share/js/kvm/mouse.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/web/share/js/kvm/mouse.js b/web/share/js/kvm/mouse.js index e070857f..984a3ba0 100644 --- a/web/share/js/kvm/mouse.js +++ b/web/share/js/kvm/mouse.js @@ -76,13 +76,14 @@ export function Mouse(__getGeometry, __recordWsEvent) { let cumulative_scrolling = !(tools.browser.is_firefox && !tools.browser.is_mac); tools.storage.bindSimpleSwitch($("hid-mouse-cumulative-scrolling-switch"), "hid.mouse.cumulative_scrolling", cumulative_scrolling); tools.slider.setParams($("hid-mouse-scroll-slider"), 1, 25, 1, tools.storage.get("hid.mouse.scroll_rate", 5), __updateScrollRate); + + tools.storage.bindSimpleSwitch($("hid-mouse-dot-switch"), "hid.mouse.dot", true, __updateOnlineLeds); }; /************************************************************************/ self.setSocket = function(ws) { __ws = ws; - $("stream-box").classList.toggle("stream-box-mouse-enabled", ws); if (!__absolute && __isRelativeCaptured()) { document.exitPointerLock(); } @@ -168,6 +169,15 @@ export function Mouse(__getGeometry, __recordWsEvent) { } $("hid-mouse-led").className = led; $("hid-mouse-led").title = title; + + if (__absolute && is_captured) { + let dot = $("hid-mouse-dot-switch").checked; + $("stream-box").classList.toggle("stream-box-mouse-dot", (dot && __ws)); + $("stream-box").classList.toggle("stream-box-mouse-none", (!dot && __ws)); + } else { + $("stream-box").classList.toggle("stream-box-mouse-dot", false); + $("stream-box").classList.toggle("stream-box-mouse-none", false); + } }; var __isRelativeCaptured = function() { |