Skip to content

Commit

Permalink
Drop horizontal scroll mouse button events on Linux to fix trackpad i…
Browse files Browse the repository at this point in the history
…ssues.
  • Loading branch information
neilcsmith-net committed Oct 31, 2023
1 parent 68bb0e8 commit 98dc2d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,9 @@
<bind actionName="jump-list-next" key="O-RIGHT"/>
<bind actionName="jump-list-next" key="O-KP_RIGHT"/>
<bind actionName="jump-list-next" key="MOUSE_BUTTON5"/>
<bind actionName="jump-list-next" key="MOUSE_BUTTON7"/>
<bind actionName="jump-list-prev" key="O-LEFT"/>
<bind actionName="jump-list-prev" key="O-KP_LEFT"/>
<bind actionName="jump-list-prev" key="MOUSE_BUTTON4"/>
<bind actionName="jump-list-prev" key="MOUSE_BUTTON6"/>
<bind actionName="page-down" key="PAGE_DOWN"/>
<bind actionName="page-up" key="PAGE_UP"/>
<bind actionName="paste-formated" key="DS-V"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,20 @@ private void processMouseEvent(MouseEvent mev) {
|| mev.isConsumed()) {
return;
}
int button = mev.getButton();
if (Utilities.getOperatingSystem() == Utilities.OS_LINUX) {
// the JDK drops buttons for vertical scroll
// drop buttons for horizontal scroll here.
button -= 2;
if (button <= 3) {
return;
}
}
//ignore when the IDE is shutting down
if (NbLifecycleManager.isExiting()) {
return;
}
int keycode = Utilities.mouseButtonKeyCode(mev.getButton());
int keycode = Utilities.mouseButtonKeyCode(button);
if (keycode == KeyEvent.VK_UNDEFINED) {
return;
}
Expand Down

0 comments on commit 98dc2d4

Please sign in to comment.