summaryrefslogtreecommitdiff
path: root/web/share/js
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2024-02-16 18:49:38 +0200
committerMaxim Devaev <[email protected]>2024-02-16 18:49:38 +0200
commit22140106c481e8f6d0a0bbb081e756fa9993ee3b (patch)
tree8bf10841a8c70db3448ba9b0020eabb29095b419 /web/share/js
parent9d33bb93ea03c3a5fe9271038fc5ab91fb871f62 (diff)
web: Option to hide blue dot
Diffstat (limited to 'web/share/js')
-rw-r--r--web/share/js/kvm/mouse.js12
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() {