Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Apr 2021 21:30:40 +0000
From:      Vladimir Kondratyev <vladimir@kondratyev.su>
To:        Michael Gmelin <freebsd@grem.de>
Cc:        Ronald Klop <ronald-lists@klop.ws>, freebsd-x11@freebsd.org, owner-freebsd-x11@freebsd.org
Subject:   Re: (solved) Re: mouse scrolling activates back/forward in browser
Message-ID:  <c7e80f102637c9ddd0670c0c1f7cd402@kondratyev.su>
In-Reply-To: <20210418224959.1343d2f5@bsd64.grem.de>
References:  <dcef9454-285c-fa97-ed42-4b15b74cd77c@klop.ws> <806D1887-2275-48C5-9CA4-715E3F57C6DB@grem.de> <47e51983-b83f-8248-29ad-c23db2523610@klop.ws> <20210418224959.1343d2f5@bsd64.grem.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2021-04-18 20:49, Michael Gmelin wrote:
> On Fri, 16 Apr 2021 21:38:29 +0200
> Ronald Klop <ronald-lists@klop.ws> wrote:
>=20
>> On 4/16/21 9:14 PM, Michael Gmelin wrote:
>> >
>> >
>> >> On 16. Apr 2021, at 21:05, Ronald Klop <ronald-lists@klop.ws>
>> >> wrote:
>> >>
>> >> =EF=BB=BFOn 4/15/21 9:11 PM, Michael Gmelin wrote:
>> >>>>> On 15. Apr 2021, at 20:54, Ronald Klop <ronald-lists@klop.ws>
>> >>>>> wrote:
>> >>>>
>> >>>> =EF=BB=BFOn 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=E2=80=99s because we switched to udev/libinput by default aro=
und
>> >>> that time.
>> >>>>> https://lists.freebsd.org/pipermail/freebsd-ports/2020-March/117=
879.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-w=
ith-firefox.57494/
>> >>>>
>> >>>> Just removed button 8 and 9.
>> >>>> xmodmap -e "pointer =3D 1 2 3 4 5 6 7 0 0 10 11 12"
>=20
> Hi Ronald,
>=20
> 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)=20
> every
> time scrolling changes direction. After that, the proper AXIS events=20
> 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.
>=20
> Instead of removing buttons with xmodmap, you can also use
>=20
>   xinput set-button-map "IntelliMouse Explorer" 1 2 3 4 5 6 7 0 0
>=20
> e.g., in ~/.xinitrc, the effect is the same.
>=20
> An alternative approach is to change virtualbox to use the USB Tablet
> driver:
>=20
>   VBoxManage modifyvm "VM Name" --mouse usbtablet
>=20
> (or using the VirtualBox GUI) and then, inside the VM, do:
>=20
>   pkg install utouch-kmod xf86-input-evdev
>   echo "utouch_load=3DYES" >>/boot/loader.conf

utouch-kmod is not required in 13+ anymore. Built-in hms(4) driver=20
handles
absolute mouses too. To enable it just insert in to /boot/loader.conf

hw.usb.usbhid.enable=3D1
usbhid_load=3D"YES"

> Create a file called /usr/local/etc/X11/xorg.d/99-vbox.conf,
> containing:
>=20
>   Section "InputClass"
>       Identifier "VirtualBox Mouse"
>       MatchIsTouchscreen "on"
>       MatchDevicePath "/dev/input/event*"
>       Driver "evdev"
>   EndSection
>=20
> and reboot, then start X.

libinput can handle such a devices, but it expect them to be tagged by=20
udev
as mouse rather than touchscreen. I made a pull request that fixes=20
libudev:
https://github.com/FreeBSDDesktop/libudev-devd/pull/21, so you can test=20
it
now or wait for it to be merged.

> (in case you're not rebooting, do "kldload utouch; kldunload uhid").
>=20
> You also need to make sure that Mouse Integration is enabled in
> VirtualBox.
>=20
> 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.
>=20
> 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.
>=20
> Best,
> Michael

--=20
WBR
Vladimir Kondratyev



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c7e80f102637c9ddd0670c0c1f7cd402>