diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/share/js/kvm/mouse.js | 10 |
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({ |