You are not logged in.

#1 2017-09-12 10:08:03

lightstream
Member
From: Britain
Registered: 2011-10-30
Posts: 69

Unable to configure mouse button-map using X config file

I use a Logitech trackball that has four buttons in addition to the ball which can be used as left click & right click, back and forward. I have also set the back button as a modifier so that I can scroll by holding that button and moving the wheel.

There's a problem with this though, in that often when you hold down the modifier key, it fires off a 'back' button press instead. So I am changing the button mapping to disable the back button (while still keeping it as the scroll modifier) and to make the forward button act like the back button (thus I have no forward button, not a major problem as I almost never use that anyway).

Here's the X config file which I use to do all this:

Section "InputClass"
        Identifier      "Marble Mouse"
        MatchProduct    "Logitech USB Trackball"
        Driver          "libinput"
        Option          "ScrollMethod"		"button"
        Option          "ScrollButton"		"8"
	Option		"MiddleEmulation"	"on"
	Option		"ButtonMapping"		"1 2 3 4 5 6 7 0 8"
EndSection

It all works as expected, except for the ButtonMapping option, which does not.

So to get the above mapping, I have to run this command each start up:

xinput set-button-map "Logitech USB Trackball" 1 2 3 4 5 6 7 0 8

Does anyone have any idea why the option in the config file is seemingly ignored?

Offline

#2 2018-03-14 18:08:57

davidm
Member
Registered: 2009-04-25
Posts: 371

Re: Unable to configure mouse button-map using X config file

An old message but I just had to set up my Logitech Marble Mouse so I figured I'd chime in.

The Wiki sample config worked perfectly for me once I installed evdev.  I notice you are using the default libinput.  If one has problems they might try using evdev.

In my case I simply used the wiki config and then installed the evdev driver with:

pacman -S xf86-input-evdev

/etc/X11/xorg.conf.d/10-evdev.conf

#       - - - Logitech Marble Mouse Settings - - -
#
#       The Logitech Marble Mouse buttons are mapped [A-D] from left to right: 
#       A (large); B (small) |  C (small); D (large). 
#
#       Preferred options for right-handed usage:
#       A = normal click [1]  
#       B = middle-click [2] 
#       C = middle-click [2] 
#       D = right-click [3]
#       Hold button B while rolling trackball to emulate wheel-scrolling. 
#
#       Preferred options for left-handed usage:
#       A = right-click [3]  
#       B = middle-click [2] 
#       C = middle-click [2]
#       D = normal click [1]
#       Hold button C while rolling trackball to emulate wheel-scrolling.
#       Pressing both large buttons simultaneously (b) produces a "back" action.

Section "InputClass"
        Identifier  "Marble Mouse"
        MatchProduct "Logitech USB Trackball"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"

#       Physical button #s:     A b D - - - - B C    
#       Option "ButtonMapping" "1 8 3 4 5 6 7 2 2"   right-hand placement
#       Option "ButtonMapping" "3 8 1 4 5 6 7 2 2"   left-hand placement
#       b = A & D 
        Option "ButtonMapping" "1 8 3 4 5 6 7 2 2"

#       EmulateWheel: Use Marble Mouse trackball as mouse wheel 
#       Factory Default: 8; Use 9 for right side small button
        Option "EmulateWheel" "true"
        Option "EmulateWheelButton" "8"

#       EmulateWheelInertia: How far (in pixels) the pointer must move to
#       generate button press/release events in wheel emulation mode.
#       Factory Default: 50
        Option "EmulateWheelInertia" "10"

#       Axis Mapping: Enable vertical [ZAxis] and horizontal [XAxis] scrolling
        Option "ZAxisMapping" "4 5"
#       Option "XAxisMapping" "6 7"

#       Emulate3Buttons: Required to interpret simultaneous press of two large
#       buttons, A & D, as a seperate command, b.
#       Factory Default: true
        Option "Emulate3Buttons" "true"
EndSection

Rebooted and now all works with the button mapping.  I'm not sure that this is optimal or if the config files between evdev and libinput can be interchanged but I thought I would share that this does work for me.

Last edited by davidm (2018-03-14 18:10:58)

Offline

#3 2018-03-14 18:38:04

lightstream
Member
From: Britain
Registered: 2011-10-30
Posts: 69

Re: Unable to configure mouse button-map using X config file

Interesting, thanks. You're right, I am using lbinput and haven't found a solution yet.

I'd prefer to use libinput if possible, although I don't have a concrete reason for doing so! (Progress innit?) If it becomes more of an annoyance, I'll think about switching to evdev.

Offline

#4 2018-03-14 18:40:42

sevendogs
Member
From: Texas
Registered: 2016-01-24
Posts: 220

Re: Unable to configure mouse button-map using X config file

Maybe I am doing this wrong but I do mouse button mapping/remapping with xmodmap and run it as a startup app. Works for me.


"Give a man a truth and he will think for a day. Teach a man to reason and he will think for a lifetime"

Offline

#5 2018-03-14 18:49:49

lightstream
Member
From: Britain
Registered: 2011-10-30
Posts: 69

Re: Unable to configure mouse button-map using X config file

sevendogs wrote:

Maybe I am doing this wrong but I do mouse button mapping/remapping with xmodmap and run it as a startup app. Works for me.

Sounds similar to what I'm doing, with "xinput set-button-map" on the command line, the main issue is that I have to re-run this command whenever I unplug and plug it back in. I've found myself doing this more than you might expect lately, just because of how I've been using my various PCs.

If I could get the setting to work in the X config file, plugging/unplugging wouldn't be a problem.

Offline

Board footer

Powered by FluxBB