diff --git a/display.js b/display.js index 2aa5985..814ada6 100644 --- a/display.js +++ b/display.js @@ -691,7 +691,7 @@ SpiceDisplayConn.prototype.hook_events = function() canvas.addEventListener('keyup', handle_keyup); canvas.addEventListener('mouseout', handle_mouseout); canvas.addEventListener('mouseover', handle_mouseover); - canvas.addEventListener('mousewheel', handle_mousewheel); + canvas.addEventListener('wheel', handle_mousewheel); canvas.focus(); } } @@ -709,7 +709,7 @@ SpiceDisplayConn.prototype.unhook_events = function() canvas.removeEventListener('keyup', handle_keyup); canvas.removeEventListener('mouseout', handle_mouseout); canvas.removeEventListener('mouseover', handle_mouseover); - canvas.removeEventListener('mousewheel', handle_mousewheel); + canvas.removeEventListener('wheel', handle_mousewheel); } } diff --git a/inputs.js b/inputs.js index c904eda..29f4970 100644 --- a/inputs.js +++ b/inputs.js @@ -141,7 +141,7 @@ function handle_mousewheel(e) { var press = new SpiceMsgcMousePress; var release = new SpiceMsgcMouseRelease; - if (e.wheelDelta > 0) + if (e.deltaY < 0) press.button = release.button = SPICE_MOUSE_BUTTON_UP; else press.button = release.button = SPICE_MOUSE_BUTTON_DOWN;