From f0e053a1b4b42ef3344032589d1c02ff21e21f6f Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 25 Aug 2018 19:56:18 +0200 Subject: Add a horizontal scroll action option for mouse wheel. Resolves #732 --- dom/events/EventStateManager.cpp | 5 +++++ dom/events/EventStateManager.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'dom/events') diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 7bbfe21b7..868bee1a3 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -3240,6 +3240,11 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext, action = WheelPrefs::GetInstance()->ComputeActionFor(wheelEvent); } switch (action) { + case WheelPrefs::ACTION_HSCROLL: { + // Swap axes and fall through + double deltaX = wheelEvent->mDeltaX; + wheelEvent->mDeltaX = wheelEvent->mDeltaY; + wheelEvent->mDeltaY = deltaX; case WheelPrefs::ACTION_SCROLL: { // For scrolling of default action, we should honor the mouse wheel // transaction. diff --git a/dom/events/EventStateManager.h b/dom/events/EventStateManager.h index d0461e7fa..95ce9a907 100644 --- a/dom/events/EventStateManager.h +++ b/dom/events/EventStateManager.h @@ -513,7 +513,8 @@ protected: ACTION_SCROLL, ACTION_HISTORY, ACTION_ZOOM, - ACTION_LAST = ACTION_ZOOM, + ACTION_HSCROLL, + ACTION_LAST = ACTION_HSCROLL, // Following actions are used only by internal processing. So, cannot // specified by prefs. ACTION_SEND_TO_PLUGIN -- cgit v1.2.3