From 055d36abd7aadc55fbcb4d547f2f245405e2b0f4 Mon Sep 17 00:00:00 2001 From: Adrian Scripca Date: Tue, 7 May 2019 19:17:02 +0300 Subject: [PATCH] All: fix spurious wheel scroll events caused when using modern mice. Modern mice feature horizontal scrolling capabilities and those end up being treated by KiCad as regular scroll events causing confusion among users. The fix works by discarding the handling of wheel events other than the ones for the vertical axis. Fixes: lp:1828080 https://bugs.launchpad.net/kicad/+bug/1828080 (cherry picked from commit e10c01aaff11d414386ce2886c9361211459d856) --- common/view/wx_view_controls.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/view/wx_view_controls.cpp b/common/view/wx_view_controls.cpp index a3decefba4..fc6dec6427 100644 --- a/common/view/wx_view_controls.cpp +++ b/common/view/wx_view_controls.cpp @@ -159,6 +159,12 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent ) m_lastTimestamp = aEvent.GetTimestamp(); #endif + // Fix issue caused by modern mice that feature horizontal scrolling by only handling + // vertical axis, otherwise horizontal scrolling events end up interpreted as vertical + // scroll events and confuse the user. + if( aEvent.GetWheelAxis() > 0 ) + return; + // mousewheelpan disabled: // wheel + ctrl -> horizontal scrolling; // wheel + shift -> vertical scrolling;