Re: (solved) Re: mouse scrolling activates back/forward in browser

Michael Gmelin <[email protected]>
Newsgroups gmane.os.freebsd.devel.x11
Message-ID <[email protected]>

On Fri, 16 Apr 2021 21:38:29 +0200
Ronald Klop <[email protected]> wrote:

> On 4/16/21 9:14 PM, Michael Gmelin wrote:
> > 
> >   
> >> On 16. Apr 2021, at 21:05, Ronald Klop <[email protected]>
> >> wrote:
> >>
> >> On 4/15/21 9:11 PM, Michael Gmelin wrote:  
> >>>>> On 15. Apr 2021, at 20:54, Ronald Klop <[email protected]>
> >>>>> wrote:  
> >>>>
> >>>> On 4/15/21 9:53 AM, Ronald Klop wrote:  
> >>>>> Hi,
> >>>>> When I use the scrollwheel of the mouse my browser triggers
> >>>>> back/forward. What happens is this: If I scroll up (button 4)
> >>>>> after scrolling down (button 5) it triggers button 8 and 9. I
> >>>>> see it generating a ButtonPress 8/9 if I go down and than up.
> >>>>> And a ButtonRelease 8/9 if I first go up and than down. I have
> >>>>> no config in /etc/X11. Xorg logs:
> >>>>> https://www.klop.ws/Xorg.0.log This happens on the trackpad of
> >>>>> the laptop and with a bluetooth connected mouse. What makes it
> >>>>> a little more complex is that this is running FreeBSD 14 in
> >>>>> VirtualBox on Windows 10 with. NB: It happened in Virtualbox 5
> >>>>> and now in 6 also. This started around a year ago.  
> >>> That’s because we switched to udev/libinput by default around
> >>> that time.  
> >>>>> https://lists.freebsd.org/pipermail/freebsd-ports/2020-March/117879.html
> >>>>> But didn't have time to look into it. Any thoughts or similar
> >>>>> experiences? Regards,
> >>>>> Ronald.  
> >>>>
> >>>>
> >>>> Some more googling found this:
> >>>> https://forums.freebsd.org/threads/mouse-wheel-strange-behavior-with-firefox.57494/
> >>>>
> >>>> Just removed button 8 and 9.
> >>>> xmodmap -e "pointer = 1 2 3 4 5 6 7 0 0 10 11 12"

Hi Ronald,

I could reproduce the issue in VirtualBox. When checking the output of
`libinput debug-events' I can see button press and release events for
BTN_SIDE and BTN_EXTRA (which maps to back and forward by default) every
time scrolling changes direction. After that, the proper AXIS events are
shown. Scrolling left and right also emits those events - therefore X11
sees button 8 and 9 instead of buttons 6 and 7. So far so good. The
problem also happens when an evdev driver is used, so it's not a
libinput problem.

Instead of removing buttons with xmodmap, you can also use

  xinput set-button-map "IntelliMouse Explorer" 1 2 3 4 5 6 7 0 0

e.g., in ~/.xinitrc, the effect is the same.

An alternative approach is to change virtualbox to use the USB Tablet
driver:

  VBoxManage modifyvm "VM Name" --mouse usbtablet

(or using the VirtualBox GUI) and then, inside the VM, do:

  pkg install utouch-kmod xf86-input-evdev
  echo "utouch_load=YES" >>/boot/loader.conf

Create a file called /usr/local/etc/X11/xorg.d/99-vbox.conf,
containing:

  Section "InputClass"
      Identifier "VirtualBox Mouse"
      MatchIsTouchscreen "on"
      MatchDevicePath "/dev/input/event*"
      Driver "evdev"
  EndSection

and reboot, then start X.
(in case you're not rebooting, do "kldload utouch; kldunload uhid").

You also need to make sure that Mouse Integration is enabled in
VirtualBox.

This will essentially have the same net-result: Vertical scrolling
works okay, no forward/back button issues, no horizontal scrolling. So
it's not necessarily worth the trouble, but I wanted to document it
anyway for future reference.

Ideally, there would be a solution that would allow the mouse to
actually emit horizontal scroll events. I suspect that the reason why
this isn't working with PS/2 emulation is in our IntelliMouse Explorer
driver, but I don't know for sure.

Best,
Michael

-- 
Michael Gmelin
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-x11
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.