diff --git a/chrome/content/firegestures/browser.js b/chrome/content/firegestures/browser.js index 0a28eb1..8f351d6 100644 --- a/chrome/content/firegestures/browser.js +++ b/chrome/content/firegestures/browser.js @@ -155,6 +155,8 @@ var FireGestures = { switch (aGesture) { case "wheel-up": case "wheel-down": + case "wheel-left": + case "wheel-right": case "rocker-left": case "rocker-right": case "keypress-ctrl": diff --git a/chrome/content/firegestures/prefs-generic.xul b/chrome/content/firegestures/prefs-generic.xul index 349a855..0490d0e 100644 --- a/chrome/content/firegestures/prefs-generic.xul +++ b/chrome/content/firegestures/prefs-generic.xul @@ -48,6 +48,7 @@ + @@ -86,6 +87,33 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/xdGestureHandler.js b/components/xdGestureHandler.js index 2ef107d..788ad00 100644 --- a/components/xdGestureHandler.js +++ b/components/xdGestureHandler.js @@ -144,13 +144,14 @@ xdGestureHandler.prototype = { this._swipeTimeout = getPref("swipe_timeout"); this._mouseGestureEnabled = getPref("mousegesture"); this._wheelGestureEnabled = getPref("wheelgesture"); + this._hwheelGestureEnabled = getPref("hwheelgesture"); this._rockerGestureEnabled = getPref("rockergesture"); this._keypressGestureEnabled = getPref("keypressgesture"); this._swipeGestureEnabled = getPref("swipegesture"); // prefs for wheel gestures and rocker gestures this._drawArea.removeEventListener("DOMMouseScroll", this, true); this._drawArea.removeEventListener("click", this, true); - if (this._wheelGestureEnabled) + if (this._wheelGestureEnabled || this._hwheelGestureEnabled) this._drawArea.addEventListener("DOMMouseScroll", this, true); if (this._rockerGestureEnabled) this._drawArea.addEventListener("click", this, true); @@ -355,6 +356,15 @@ xdGestureHandler.prototype = { // required to suppress page scroll if using SmoothWheel or Yet Another Smooth Scrolling event.stopPropagation(); } + if (event.axis == 1) { + this._state = STATE_WHEEL; + this._invokeExtraGesture(event, event.detail < 0 ? "wheel-left" : "wheel-right"); + // suppress page scroll + event.preventDefault(); + // required to suppress page scroll if using SmoothWheel or Yet Another Smooth Scrolling + event.stopPropagation(); + this._state = STATE_READY; + } break; case "click": // this fixes the bug: performing rocker-left on a link causes visiting the link diff --git a/defaults/preferences/firegestures-prefs.js b/defaults/preferences/firegestures-prefs.js index 5229c11..93735f9 100644 --- a/defaults/preferences/firegestures-prefs.js +++ b/defaults/preferences/firegestures-prefs.js @@ -1,5 +1,6 @@ pref("extensions.firegestures.mousegesture", true); pref("extensions.firegestures.wheelgesture", true); +pref("extensions.firegestures.hwheelgesture", false); pref("extensions.firegestures.rockergesture", false); pref("extensions.firegestures.keypressgesture", true); pref("extensions.firegestures.tabwheelgesture", false);