diff options
author | Devaev Maxim <[email protected]> | 2019-10-01 05:48:20 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-10-01 05:48:20 +0300 |
commit | 8cc5f631cafe84794c878244649ab11087631efd (patch) | |
tree | cca3e02fe967f5291b2ff791ad871e9e1fcf990e /web | |
parent | 74931a8096aed89ef7d03e327978d1a2963c92c7 (diff) |
horizontal scrolling for otg
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({ |