summaryrefslogtreecommitdiff
path: root/web/share/js/kvm/mouse.js
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-05-24 00:17:40 +0300
committerMaxim Devaev <[email protected]>2022-05-24 00:17:40 +0300
commit55e67e32ae40c7774b160906458faaa9b98b813a (patch)
treed96b97cc55fc48a18d3bdb2e92d6c45118cb1f46 /web/share/js/kvm/mouse.js
parent232873a77b12640cf4361f1c58b9951ca8f3e28c (diff)
pikvm/pikvm#739: reversed mouse option
Diffstat (limited to 'web/share/js/kvm/mouse.js')
-rw-r--r--web/share/js/kvm/mouse.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/web/share/js/kvm/mouse.js b/web/share/js/kvm/mouse.js
index cbcd99da..3be12cd7 100644
--- a/web/share/js/kvm/mouse.js
+++ b/web/share/js/kvm/mouse.js
@@ -64,6 +64,7 @@ export function Mouse(__getGeometry, __recordWsEvent) {
$("stream-box").ontouchstart = (event) => __streamTouchMoveHandler(event);
tools.storage.bindSimpleSwitch($("hid-mouse-squash-switch"), "hid.mouse.squash", true);
+ tools.storage.bindSimpleSwitch($("hid-mouse-reverse-scrolling-switch"), "hid.mouse.reverse_scrolling", false);
tools.slider.setParams($("hid-mouse-sens-slider"), 0.1, 1.9, 0.1, tools.storage.get("hid.mouse.sens", 1.0), __updateRelativeSens);
tools.slider.setParams($("hid-mouse-rate-slider"), 10, 100, 10, tools.storage.get("hid.mouse.rate", 100), __updateRate); // set __timer
};
@@ -280,6 +281,10 @@ export function Mouse(__getGeometry, __recordWsEvent) {
}
if (delta.x || delta.y) {
+ if ($("hid-mouse-reverse-scrolling-switch").checked) {
+ delta.x *= -1;
+ delta.y *= -1;
+ }
tools.debug("Mouse: scrolled:", delta);
__sendEvent("mouse_wheel", {"delta": delta});
}