summaryrefslogtreecommitdiff
path: root/web/share/js/kvm/mouse.js
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-08-24 13:16:00 +0300
committerMaxim Devaev <[email protected]>2023-08-24 13:16:00 +0300
commit81d67c6ed7859501a8ee67a047d27e516fba96ae (patch)
tree0ef7f09864a52f63dcaadf931edfc85d5791af48 /web/share/js/kvm/mouse.js
parente78d3e03ec91e67e3b3b7c6397d1231a186a0b55 (diff)
pikvm/pikvm#1094: web: separate switch for reversed scrolling and panning
Diffstat (limited to 'web/share/js/kvm/mouse.js')
-rw-r--r--web/share/js/kvm/mouse.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/web/share/js/kvm/mouse.js b/web/share/js/kvm/mouse.js
index f2d6afde..40ea66ca 100644
--- a/web/share/js/kvm/mouse.js
+++ b/web/share/js/kvm/mouse.js
@@ -72,6 +72,7 @@ export function Mouse(__getGeometry, __recordWsEvent) {
tools.slider.setParams($("hid-mouse-rate-slider"), 10, 100, 10, tools.storage.get("hid.mouse.rate", 100), __updateRate); // set __timer
tools.storage.bindSimpleSwitch($("hid-mouse-reverse-scrolling-switch"), "hid.mouse.reverse_scrolling", false);
+ tools.storage.bindSimpleSwitch($("hid-mouse-reverse-panning-switch"), "hid.mouse.reverse_panning", false);
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);
@@ -310,9 +311,11 @@ export function Mouse(__getGeometry, __recordWsEvent) {
var __sendScroll = function(delta) {
if (delta.x || delta.y) {
if ($("hid-mouse-reverse-scrolling-switch").checked) {
- delta.x *= -1;
delta.y *= -1;
}
+ if ($("hid-mouse-reverse-panning-switch").checked) {
+ delta.x *= -1;
+ }
tools.debug("Mouse: scrolled:", delta);
__sendEvent("mouse_wheel", {"delta": delta});
}