This is an automated email from the ASF dual-hosted git repository.

neilcsmith pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
     new 0e0560d950 Drop horizontal scroll mouse button events on Linux to fix 
trackpad issues.
     new efe5e1735d Merge pull request #6644 from 
neilcsmith-net/mouse-linux-horiz-scroll
0e0560d950 is described below

commit 0e0560d95027d4fca137921bcb480e3d8fad6076
Author: Neil C Smith <[email protected]>
AuthorDate: Tue Oct 31 14:21:57 2023 +0000

    Drop horizontal scroll mouse button events on Linux to fix trackpad issues.
---
 .../modules/editor/resources/NetBeans-keybindings.xml         |  2 --
 .../core/windows/ShortcutAndMenuKeyEventProcessor.java        | 11 ++++++++++-
 platform/openide.util.ui/src/org/openide/util/Utilities.java  |  8 +++++++-
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git 
a/ide/editor/src/org/netbeans/modules/editor/resources/NetBeans-keybindings.xml 
b/ide/editor/src/org/netbeans/modules/editor/resources/NetBeans-keybindings.xml
index 9181a8ec6a..fcb9bc4caa 100644
--- 
a/ide/editor/src/org/netbeans/modules/editor/resources/NetBeans-keybindings.xml
+++ 
b/ide/editor/src/org/netbeans/modules/editor/resources/NetBeans-keybindings.xml
@@ -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"/>
diff --git 
a/platform/core.windows/src/org/netbeans/core/windows/ShortcutAndMenuKeyEventProcessor.java
 
b/platform/core.windows/src/org/netbeans/core/windows/ShortcutAndMenuKeyEventProcessor.java
index 4d8eea21ad..f26e59f59b 100644
--- 
a/platform/core.windows/src/org/netbeans/core/windows/ShortcutAndMenuKeyEventProcessor.java
+++ 
b/platform/core.windows/src/org/netbeans/core/windows/ShortcutAndMenuKeyEventProcessor.java
@@ -318,11 +318,20 @@ final class ShortcutAndMenuKeyEventProcessor implements 
KeyEventDispatcher, KeyE
                 || 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;
         }
diff --git a/platform/openide.util.ui/src/org/openide/util/Utilities.java 
b/platform/openide.util.ui/src/org/openide/util/Utilities.java
index faf0d04f88..29402965a7 100644
--- a/platform/openide.util.ui/src/org/openide/util/Utilities.java
+++ b/platform/openide.util.ui/src/org/openide/util/Utilities.java
@@ -842,7 +842,13 @@ public final class Utilities {
      * {@link KeyEvent#VK_UNDEFINED} if not available.
      * <p>
      * Implementation note : only extended mouse buttons in the range BUTTON4 
to
-     * BUTTON9 are currently mapped to keycodes.
+     * BUTTON9 are currently mapped to keycodes. The caller may pass in values
+     * that best reflect the desired mouse button rather than the actual value
+     * from the OS or MouseEvent. eg. on Linux, the JDK excludes X button 
values
+     * for vertical scrolling when generating the range of buttons, and the
+     * default NetBeans window system further excludes the horizontal scroll
+     * button values - button 4 passed in here might be JDK button 6 and X 
event
+     * button 8.
      *
      * @param button mouse button
      * @return keycode if defined


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to