You are not logged in.

#1 2017-01-06 15:36:43

davama
Member
From: NY
Registered: 2014-02-07
Posts: 45

Xorg xev not detect extra mouse button

Basically i would like to assign/map the right most mouse button but Xorg cannot seem to recognize it.
I've googled around quiet a bit trying to figure out what is going on or what to do.

I just purchased an ELECOM TrackBall Mouse M-XT3DRBK and it works out of the box.
According to the manual button 6 (right most) has nothing assinged to it. You can use the software assistance to assign some function to it. I tested that feature using a VM and was able to assing the "Start menu" (which to me sounds like the windowsbutton). I thought that assigning it was coded in the hardware but still nothing when i use the mouse on the linux side.

`xinput` can recognize all the buttons

$ xinput list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
...
⎜   ↳ ELECOM ELECOM TrackBall Mouse           	id=9	[slave  pointer  (2)]
....
$ xinput query-state 9
3 classes :
KeyClass
...
ButtonClass
	button[1]=up
	button[2]=up
	button[3]=up
	button[4]=up
	button[5]=up
	button[6]=up
	button[7]=up
	button[8]=up
	button[9]=up
	button[10]=up
	button[11]=up
	button[12]=up
	button[13]=up
....

Now with `xev` im able to identify each button all the way to number 9. Also tested with `evtest` but cannot see right most button event (assuming it button10).

xev | grep -A2 --line-buffered '^ButtonRelease' | sed -n '/button /s/^.*button \([0-9]*\).*/\1/p'
1
2
3
4
5
6
7
8
9
<press right most button but no output>

I also added a an "InputClass" to my xorg.conf file:

Section "InputClass"
	Identifier "Mouse0"
	Driver "evdev"
	MatchProduct "ELECOM ELECOM TrackBall Mouse"
	MatchIsPointer "true"
#	Option "CorePointer"
	Option "Buttons" "13"
	Option "ButtonMapping" "1 2 3 4 5 6 7 8 9 10"
# set the following to 1 1 0 respectively to disable acceleration.
	Option "AccelerationNumerator" "6"
	Option "AccelerationDenominator" "1"
	Option "AccelerationThreshold" "4"
EndSection

This produces the following logs /var/log/Xorg.0.log:

....
[150792.778] (**) Option "xkb_rules" "evdev"
[150792.779] (II) config/udev: Adding input device ELECOM ELECOM TrackBall Mouse (/dev/input/event10)
[150792.779] (**) ELECOM ELECOM TrackBall Mouse: Applying InputClass "evdev pointer catchall"
[150792.779] (**) ELECOM ELECOM TrackBall Mouse: Applying InputClass "evdev keyboard catchall"
[150792.779] (**) ELECOM ELECOM TrackBall Mouse: Applying InputClass "Mouse0"
[150792.779] (II) Using input driver 'evdev' for 'ELECOM ELECOM TrackBall Mouse'
[150792.779] (**) ELECOM ELECOM TrackBall Mouse: always reports core events
[150792.779] (**) evdev: ELECOM ELECOM TrackBall Mouse: Device: "/dev/input/event10"
[150792.779] (**) evdev: ELECOM ELECOM TrackBall Mouse: ButtonMapping '1 2 3 4 5 6 7 8 9 10 11 12 13'
[150792.779] (--) evdev: ELECOM ELECOM TrackBall Mouse: Vendor 0x56e Product 0xfc
[150792.779] (--) evdev: ELECOM ELECOM TrackBall Mouse: Found 9 mouse buttons
[150792.779] (--) evdev: ELECOM ELECOM TrackBall Mouse: Found scroll wheel(s)
[150792.779] (--) evdev: ELECOM ELECOM TrackBall Mouse: Found relative axes
[150792.779] (--) evdev: ELECOM ELECOM TrackBall Mouse: Found x and y relative axes
[150792.779] (--) evdev: ELECOM ELECOM TrackBall Mouse: Found absolute axes
[150792.779] (II) evdev: ELECOM ELECOM TrackBall Mouse: Forcing absolute x/y axes to exist.
[150792.779] (--) evdev: ELECOM ELECOM TrackBall Mouse: Found keys
[150792.779] (II) evdev: ELECOM ELECOM TrackBall Mouse: Configuring as mouse
[150792.779] (II) evdev: ELECOM ELECOM TrackBall Mouse: Configuring as keyboard
[150792.779] (II) evdev: ELECOM ELECOM TrackBall Mouse: Adding scrollwheel support
[150792.779] (**) evdev: ELECOM ELECOM TrackBall Mouse: YAxisMapping: buttons 4 and 5
[150792.779] (**) evdev: ELECOM ELECOM TrackBall Mouse: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[150792.779] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4.1/1-1.4.1:1.0/0003:056E:00FC.0006/input/input18/event10"
[150792.779] (II) XINPUT: Adding extended input device "ELECOM ELECOM TrackBall Mouse" (type: KEYBOARD, id 9)
[150792.779] (**) Option "xkb_rules" "evdev"
[150792.779] (II) evdev: ELECOM ELECOM TrackBall Mouse: initialized for relative axes.
[150792.779] (WW) evdev: ELECOM ELECOM TrackBall Mouse: ignoring absolute axes.
[150792.779] (**) ELECOM ELECOM TrackBall Mouse: (accel) keeping acceleration scheme 1
[150792.779] (**) ELECOM ELECOM TrackBall Mouse: (accel) acceleration profile 0
[150792.779] (**) Option "AccelerationNumerator" "6"
[150792.779] (**) Option "AccelerationDenominator" "1"
[150792.780] (**) Option "AccelerationThreshold" "4"
[150792.780] (**) ELECOM ELECOM TrackBall Mouse: (accel) acceleration factor: 6.000
[150792.780] (**) ELECOM ELECOM TrackBall Mouse: (accel) acceleration threshold: 4
[150792.780] (II) config/udev: Adding input device ELECOM ELECOM TrackBall Mouse (/dev/input/mouse0)
[150792.780] (**) ELECOM ELECOM TrackBall Mouse: Applying InputClass "Mouse0"
[150792.780] (II) Using input driver 'evdev' for 'ELECOM ELECOM TrackBall Mouse'
[150792.780] (**) ELECOM ELECOM TrackBall Mouse: always reports core events
[150792.780] (**) evdev: ELECOM ELECOM TrackBall Mouse: Device: "/dev/input/mouse0"
[150792.780] (EE) evdev: ELECOM ELECOM TrackBall Mouse: Unable to query fd: Inappropriate ioctl for device
[150792.824] (EE) PreInit returned 2 for "ELECOM ELECOM TrackBall Mouse"
[150792.824] (II) UnloadModule: "evdev"
....

I find interesting that it says "Found 9 mouse buttons".
Anywhere else to look? Am i doing the right steps here?

Any input is appreciated.

Thanks
Dave


Kernel: 4.8.13-1-ARCH
Xorg: 1.18.4

Offline

#2 2017-01-07 02:10:41

seth
Member
Registered: 2012-09-03
Posts: 51,236

Re: Xorg xev not detect extra mouse button

4 buttons are x/y wheels, this line is a really bad idea

Option "ButtonMapping" "1 2 3 4 5 6 7 8 9 10"

and the reason is probably that the button is used for wheel emulation? you'll need to dsable that feature or assign another button (using xinput)

Online

#3 2017-01-09 13:23:55

davama
Member
From: NY
Registered: 2014-02-07
Posts: 45

Re: Xorg xev not detect extra mouse button

@seth thanks for replying

seth wrote:

4 buttons are x/y wheels, this line is a really bad idea

Option "ButtonMapping" "1 2 3 4 5 6 7 8 9 10"

how should i write it? remove it instead altogether?

seth wrote:

probably that the button is used for wheel emulation? you'll need to dsable that feature or assign another button

I believe you mean yaxis = 4,5 and xaxis 6,7 which is true. That works out of the box on browsers. I dont understand how that would help `xev` detect the right most button (physical button 6). But i think we are confusing physical button 6 from the manual to xorg button 6 on linux.

As said before the manufacturer ships the mouse with "physical button 6" unassigned. It stinks that `xev` does not detect it.

I've added the properties that `xinput` sees. Interestingly buttons 1-9 have labels on them. 10-13 do not. I really dont know which button # the right most (button 6) would be. Assuming it would be 10.

Thanks
$ xinput list-props 9
Device 'ELECOM ELECOM TrackBall Mouse':
	Device Enabled (135):	1
	Coordinate Transformation Matrix (137):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	Device Accel Profile (265):	0
	Device Accel Constant Deceleration (266):	1.000000
	Device Accel Adaptive Deceleration (267):	1.000000
	Device Accel Velocity Scaling (268):	10.000000
	Device Product ID (255):	1390, 252
	Device Node (256):	"/dev/input/event10"
	Evdev Axis Inversion (269):	0, 0
	Evdev Axes Swap (271):	0
	Axis Labels (272):	"Rel X" (145), "Rel Y" (146), "Rel Horiz Wheel" (262), "Rel Dial" (263), "Rel Vert Wheel" (264)
	Button Labels (273):	"Button Left" (138), "Button Middle" (139), "Button Right" (140), "Button Wheel Up" (141), "Button Wheel Down" (142), "Button Horiz Wheel Left" (143), "Button Horiz Wheel Right" (144), "Button Side" (260), "Button Extra" (261), "Button Unknown" (258), "Button Unknown" (258), "Button Unknown" (258), "Button Unknown" (258)
	Evdev Scrolling Distance (274):	1, 1, 1
	Evdev Middle Button Emulation (275):	0
	Evdev Middle Button Timeout (276):	50
	Evdev Third Button Emulation (277):	0
	Evdev Third Button Emulation Timeout (278):	1000
	Evdev Third Button Emulation Button (279):	3
	Evdev Third Button Emulation Threshold (280):	20
	Evdev Wheel Emulation (281):	0
	Evdev Wheel Emulation Axes (282):	0, 0, 4, 5
	Evdev Wheel Emulation Inertia (283):	10
	Evdev Wheel Emulation Timeout (284):	200
	Evdev Wheel Emulation Button (285):	4
	Evdev Drag Lock Buttons (286):	0

Offline

#4 2017-01-09 20:50:55

seth
Member
Registered: 2012-09-03
Posts: 51,236

Re: Xorg xev not detect extra mouse button

Sorry, I think I missed the part where you said evtest doesn't recognize the button either. Is that true?
In that case, there's likely no event generated by the kernel (usb_hid) what means either the mouse does not generate an event.

Do you get raw output from the input device? ("sudo cat /dev/input/event<n>", evtest tells you <n>)

Otherwise additional runtime config of the mouse may be required (like lomoco does for logitech mice)

Online

Board footer

Powered by FluxBB