From fb233da532cf6c95c18c1878521c62246f60463e Mon Sep 17 00:00:00 2001 From: Adam Jimenez Date: Mon, 13 Jan 2014 09:46:53 +0000 Subject: [PATCH] shift+mousewheel to horiz scroll Converts shift+mousewheel to horizontal scroll. This is in accordance with Chrome which supports this shortcut on webpages and textareas. --- lib/ace/mouse/default_handlers.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ace/mouse/default_handlers.js b/lib/ace/mouse/default_handlers.js index 4e28d9d3..7e895f30 100644 --- a/lib/ace/mouse/default_handlers.js +++ b/lib/ace/mouse/default_handlers.js @@ -235,8 +235,15 @@ function DefaultHandlers(mouseHandler) { }; this.onMouseWheel = function(ev) { - if (ev.getShiftKey() || ev.getAccelKey()) + if (ev.getAccelKey()) return; + + //shift wheel to horiz scroll + if (ev.getShiftKey() && ev.wheelY && !ev.wheelX) { + ev.wheelX = ev.wheelY; + ev.wheelY = 0; + } + var t = ev.domEvent.timeStamp; var dt = t - (this.$lastScrollTime||0);