#505 Fix for the scroll click suppression

None
closed-accepted
Alan Ezust
5
2014-08-15
2013-07-29
EdorFaus
No

Recently, I've found that the click on horizontal scroll problem that was fixed with patch #3134788 has resurfaced.

I tracked it down to a change in the behaviour of my JRE, which has apparently started sending horizontal scroll events as mouse button presses with button numbers 4 and 5. (Such numbers > 3 are documented to be allowed with Java 1.7, so this probably started after an upgrade to that.)

Since the original patch (and the current trunk) simply checks for the event's button being MouseEvent.NOBUTTON, these "clicks" are not caught and suppressed.

This patch replaces the check for NOBUTTON with an inverse check for BUTTON1 or BUTTON2 or BUTTON3, since those are the buttons that jEdit currently knows how to handle (as far as I know).

While it would be better to handle these "clicks" as scroll events instead of suppressing them, I don't know how to do that, and I don't know how universal the 4 and 5 would be either - so trying to do that might be trading one problem for another.

Discussion

  • EdorFaus
    EdorFaus
    2013-07-29

    Fix for the mouse button check

     
    Attachments
  • Alan Ezust
    Alan Ezust
    2014-03-30

    • assigned_to: Alan Ezust
    • Group: -->
     
  • Alan Ezust
    Alan Ezust
    2014-03-31

    What bug does this fix? How do I test it?

     
  • EdorFaus
    EdorFaus
    2014-04-02

    I see the ticket system has been changed, with everything renumbered - the one I was referring to is now [patches:#373].

    In short, the problem is that jEdit doesn't support my touchpad's horizontal scrolling feature*, and responds to such scrolling basically as if I clicked the left mouse button, which is especially annoying in the main text area, as it moves the cursor when I didn't want it to be moved.

    *) It uses a two-finger drag for scrolling: up/down for vertical (normal) scrolling, left/right for horizontal (sideways) scrolling - and it's rather difficult to not move at least a little left/right while scrolling up/down.

    The original patch fixed the annoyance by having jEdit ignore the horizontal scrolling events altogether (I didn't see how scrolling could be implemented using them, since the events were all NOBUTTON, and ignoring them was better than status quo).

    Then the JRE changed its behaviour to not use NOBUTTON anymore, as explained in this issue, hence the new patch - which I think is technically better than the original even without the change, as it makes jEdit check if the clicked button is a supported button, instead of checking for it being no button at all.

    To test it I guess you'll need some mouse-type input device that can do horizontal scrolling, but I guess a mouse with extra buttons might be able to simulate it.

    Just as a data point though, I've been running my jEdit install with this patch since I wrote it, and I haven't had any problems yet (I usually forget it's there actually).

     

    Related

    Patches: #373

  • Alan Ezust
    Alan Ezust
    2014-04-06

    • status: open --> closed-accepted
     
  • Alan Ezust
    Alan Ezust
    2014-04-06

    Committed 23460. Thanks!