summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-10-01 05:48:20 +0300
committerDevaev Maxim <[email protected]>2019-10-01 05:48:20 +0300
commit8cc5f631cafe84794c878244649ab11087631efd (patch)
treecca3e02fe967f5291b2ff791ad871e9e1fcf990e /web
parent74931a8096aed89ef7d03e327978d1a2963c92c7 (diff)
horizontal scrolling for otg
Diffstat (limited to 'web')
-rw-r--r--web/share/js/kvm/mouse.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/web/share/js/kvm/mouse.js b/web/share/js/kvm/mouse.js
index 85efa199..03d90a06 100644
--- a/web/share/js/kvm/mouse.js
+++ b/web/share/js/kvm/mouse.js
@@ -190,13 +190,19 @@ export function Mouse() {
let delta = {x: 0, y: 0};
- __wheel_delta.y += event.deltaY;
+ __wheel_delta.x += event.deltaX; // Horizontal scrolling
+ if (Math.abs(__wheel_delta.x) >= 100) {
+ delta.x = __wheel_delta.x / Math.abs(__wheel_delta.x) * (-5);
+ __wheel_delta.x = 0;
+ }
+
+ __wheel_delta.y += event.deltaY; // Vertical scrolling
if (Math.abs(__wheel_delta.y) >= 100) {
delta.y = __wheel_delta.y / Math.abs(__wheel_delta.y) * (-5);
__wheel_delta.y = 0;
}
- if (delta.y) {
+ if (delta.x || delta.y) {
tools.debug("Mouse: scrolled:", delta);
if (__ws) {
__ws.send(JSON.stringify({