You are not logged in.

#1 2015-11-03 18:18:02

Kazurik
Member
Registered: 2012-01-07
Posts: 8

Arch as a Virtualbox guest on a Surface Pro 3 can't middle mouse click

After installing arch as a guest in Virtualbox on my Windows 10 machine everything works out of the box except for my ability to do a middle mouse click. Left and right click, either through tapping the lower right of the touchpad or a 2 finger tap, all works however a 3 finger click does not.

When I open xev and do a 3 finger tap I get the following output:

KeyPress event, serial 32, synthetic NO, window 0x1c00001,
    root 0x26b, subw 0x0, time 649531, (14,762), root:(1101,804),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 32, synthetic NO, window 0x1c00001,
    root 0x26b, subw 0x0, time 649531, (14,762), root:(1101,804),
    state 0x4, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 32, synthetic NO, window 0x1c00001,
    root 0x26b, subw 0x0, time 649533, (14,762), root:(1101,804),
    state 0x5, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 32, synthetic NO, window 0x1c00001,
    root 0x26b, subw 0x0, time 649533, (14,762), root:(1101,804),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Does anyone know how I would fix this?

Offline

#2 2015-11-05 12:10:03

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Arch as a Virtualbox guest on a Surface Pro 3 can't middle mouse click

Your evdev log show only keyboard events, not mouse related events (you should see ButtonPress). I am not sure how middle mouse click is generated by your touchpad nor if it is implemented at all (middle mouse click are not really used in Windows). Linux offer the ability to emulate a middle click by clicking the left and right button at the same time (can you generate that with your touchpad?). I am not sure it is enabled by default but you should be able to enable. Create a file /etc/X11/xorg.conf.d/00-mouse.conf with the following content:

Section "InputClass"
        Identifier "evdev pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Option "Emulate3Buttons"     "True"
        Driver "evdev"
EndSection

Last edited by olive (2015-11-05 12:10:42)

Offline

#3 2015-11-05 14:04:15

Kazurik
Member
Registered: 2012-01-07
Posts: 8

Re: Arch as a Virtualbox guest on a Surface Pro 3 can't middle mouse click

olive wrote:

Your evdev log show only keyboard events, not mouse related events (you should see ButtonPress). I am not sure how middle mouse click is generated by your touchpad nor if it is implemented at all (middle mouse click are not really used in Windows).

Middle mouse click is indeed used a lot in Windows as it is the easiest way to open a link in a new tab in all major browsers. It does indeed function correctly on the host OS of Windows 10.

As far as the ButtonPress/ButtonRelease it is very odd that I get a ctrl and shift input when I 3 finger tap on the pad in Arch. A single finger tap, left click, and a two finger tap, right click, do indeed work correctly and xev's output for these actions are below. First left click and then right click.

ButtonPress event, serial 32, synthetic NO, window 0x1800001,
    root 0x26b, subw 0x0, time 22120, (38,280), root:(1125,322),
    state 0x0, button 1, same_screen YES

ButtonRelease event, serial 32, synthetic NO, window 0x1800001,
    root 0x26b, subw 0x0, time 22336, (38,280), root:(1125,322),
    state 0x100, button 1, same_screen YES

ButtonPress event, serial 32, synthetic NO, window 0x1800001,
    root 0x26b, subw 0x0, time 23431, (38,280), root:(1125,322),
    state 0x0, button 3, same_screen YES

ButtonRelease event, serial 32, synthetic NO, window 0x1800001,
    root 0x26b, subw 0x0, time 23441, (38,280), root:(1125,322),
    state 0x400, button 3, same_screen YES

I have tried the X11 .conf file to see if that would work send a middle mouse when I push down on the bottom left and bottom right of the Type Cover touchpad directly. Sadly it does not seem to work as it sends only a right click. I did plug in a normal mouse to verify that the .conf file was loaded and indeed with a normal mouse a left and right click at the same time generate a middle mouse click.

Any other ideas, thanks?

Offline

#4 2015-11-05 14:37:37

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Arch as a Virtualbox guest on a Surface Pro 3 can't middle mouse click

I believe your touchpad does not really generates middle click. It generates something (maybe keyboard events) and Windows has been configured (perhaps by the touchpad driver) to emulate the behaviour of a middle click when these events are generated. What actually happens when you click on the middle button (i.e. the scroll wheel) of a physical mouse? If I am right, you would have to resort to dirty tricks in Linux. You can generate mouse and keyboard events with xvkbd. For example the following code send a middle click to the active windows:

 xvkbd -xsendevents -text '\m2'

Maybe you can bind that with your WM/DE/xbindkeys to a key combination of your choice. Maybe the one you see in xev. Maybe there is a proper solution to reconfigure Xorg but I am not sure.

As for the middle click emulation, both buttons should be pressed "at the same time" and I believe it is the reason it does not works with your touchpad. You can configure what "at the same time" means (see man evdev, particularly Emulate3Timeout). The problem might also be that the touchpad send a Release Event of the first button before a  KeyPress event of the third and that of couse does not count for "at the same time".

It would be interesting to find a kind of xev equivalent for Windows to really understand what the touchpad send. I don't know if that exists.

Last edited by olive (2015-11-05 14:53:37)

Offline

Board footer

Powered by FluxBB