Difference between revisions of "Xinput"

From S23Wiki
Jump to: navigation, search
Line 1: Line 1:
 +
A Quick guide to setting up additional devices on Linux
 +
This guide was written on a desktop running Debian 8.0 it uses systemD the below will probably only work on that OS and its descendants
  
A Quick guide to setting up adisional devices on Linux
 
This guide was written on a desktop running Debian 8.0 it uses systemD the below will probally only work on that OS and its decentants
 
  
 +
= General xinput =
  
== General ximput ==
+
== List all input devices ==
 
+
=== List all input devives ===
+
  
 
  # xinput list [--long]
 
  # xinput list [--long]
Line 28: Line 27:
 
     ↳ ThinkPad Extra Buttons                  id=16 [slave  keyboard (3)]
 
     ↳ ThinkPad Extra Buttons                  id=16 [slave  keyboard (3)]
  
=== Get detales of an input device  ===
+
== Get details of an input device  ==
  
 
   # xinput list-props [device id] "[device name]"
 
   # xinput list-props [device id] "[device name]"
Line 65: Line 64:
 
    
 
    
  
== Setting up "Kensington Kensington Slimblade Trackball" ==
+
= Setting up "Kensington Kensington Slimblade Trackball" =
 +
 
 +
== xinput version 1.6.2 ==
 +
It seems in newer versions of xinput (used in Debian Stretch) use the options ScrollButton and ScrollMethod.
 +
Looking at the man page: [https://www.mankier.com/4/libinput] for inspiration I believe the below config will work.
 +
 
 +
=== Set up via xinput ===
 +
 
 +
xinput set-prop "Kensington Kensington Slimblade Trackball" "libinput Button Scrolling Button" 8
 +
xinput set-prop "Kensington Kensington Slimblade Trackball" "libinput Scroll Method Enabled" 0, 0, 1
 +
 
 +
The first line is telling the xinput system use the upper-right button (Button 8 ) to trigger the navigation mode.
 +
The second line is to set the ScrollMethod method to button
 +
 
 +
I don't think this is quite the right way to do it but it works for me!
 +
 
 +
 
 +
=== Via xorg.conf.d ===
 +
 
 +
Create a file called "23-Kensington_Slimblade_Trackball.conf" in your xorg.conf.d (on Debian Stretch /usr/share/X11/xorg.conf.d/23-Kensington_Slimblade_Trackball.conf) with the below content
 +
 
 +
Section "InputClass"
 +
        Identifier      "Trackpoint Wheel Emulation"
 +
        MatchProduct    "Kensington Kensington Slimblade Trackball"
 +
        MatchDevicePath "/dev/input/event*"
 +
        Option          "ScrollButton"          "8"
 +
        Option          "ScrollMethod"          "button"
 +
        Option          "XAxisMapping"          "6 7"
 +
        Option          "YAxisMapping"          "4 5"
 +
EndSection
 +
 
 +
Reload the udev rules
 +
# udevadm control --reload-rules
 +
 
 +
 
 +
 
 +
== xinput version ($OLDER) ==
  
 
=== Set up via xinput ===
 
=== Set up via xinput ===
Line 76: Line 111:
  
 
The first line is telling the xinput system to enable the mouse wheel emulation (similar to the navigation mode)
 
The first line is telling the xinput system to enable the mouse wheel emulation (similar to the navigation mode)
 
 
The second line is to use the upper-right button (Button 8 ) to trigger the navigation mode.
 
The second line is to use the upper-right button (Button 8 ) to trigger the navigation mode.
 
 
The third line make it work for both vertical and horizontal scroll.
 
The third line make it work for both vertical and horizontal scroll.
  
  
==== Depricated methord for the same  ====
+
 
 +
==== Deprecated method for the same  ====
 
  # xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation" 8 1
 
  # xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation" 8 1
 
  # xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Button" 8 8
 
  # xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Button" 8 8
Line 91: Line 125:
 
=== Via xorg.conf.d ===
 
=== Via xorg.conf.d ===
  
A very much work in progress but this seems to be working  
+
a very much work in progress but this seems to be working  
 +
 
  
  
 
Some distributions now support the new Xorg hotplug configuration method via xorg.conf.d directories (in Ubuntu 10.04 Lucid Lynx) instead of hal. In contrast to the udev method below, it should be around for some time, so it might be the best way to “statically” configure scrolling.
 
Some distributions now support the new Xorg hotplug configuration method via xorg.conf.d directories (in Ubuntu 10.04 Lucid Lynx) instead of hal. In contrast to the udev method below, it should be around for some time, so it might be the best way to “statically” configure scrolling.
  
Create the file /usr/share/X11/xorg.conf.d/23-Kensington_Slimblade_Trackball.conf as root with the below content:  
+
Create the file /usr/share/X11/xorg.conf.d/23-Kensington_Slimblade_Trackball.conf as root with the following content:  
Some systems use /usr/lib/X11/xorg.conf.d instead
+
  Some systems use /usr/lib/X11/xorg.conf.d instead
  
cat /usr/share/X11/xorg.conf.d/23-Kensington_Slimblade_Trackball.conf
 
 
  Section "InputClass"
 
  Section "InputClass"
 
  Identifier "Trackpoint Wheel Emulation"
 
  Identifier "Trackpoint Wheel Emulation"
Line 109: Line 143:
 
  Option "YAxisMapping" "4 5"
 
  Option "YAxisMapping" "4 5"
 
  EndSection
 
  EndSection
 
  
  
Line 125: Line 158:
 
[http://yjpark.blogspot.co.uk/2010/04/using-trackball-on-linux.html]  
 
[http://yjpark.blogspot.co.uk/2010/04/using-trackball-on-linux.html]  
 
[http://www.x.org/archive/X11R7.5/doc/man/man4/evdev.4.html]
 
[http://www.x.org/archive/X11R7.5/doc/man/man4/evdev.4.html]
 +
[https://www.mankier.com/4/libinput]

Revision as of 02:17, 30 June 2016

A Quick guide to setting up additional devices on Linux This guide was written on a desktop running Debian 8.0 it uses systemD the below will probably only work on that OS and its descendants


General xinput

List all input devices

# xinput list [--long]

e.g.

xinput list
 Virtual core pointer                    	id=2	[master pointer  (3)]
   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
   ↳ Kensington Kensington Slimblade Trackball	id=11	[slave  pointer  (2)]
   ↳ SynPS/2 Synaptics TouchPad              	id=14	[slave  pointer  (2)]
   ↳ TPPS/2 IBM TrackPoint                   	id=15	[slave  pointer  (2)]
 Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Video Bus                               	id=7	[slave  keyboard (3)]
    ↳ Video Bus                               	id=8	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=9	[slave  keyboard (3)]
    ↳ Integrated Camera                       	id=10	[slave  keyboard (3)]
    ↳ Sun USB Keyboard                        	id=12	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=13	[slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                  	id=16	[slave  keyboard (3)]

Get details of an input device

 # xinput list-props [device id] "[device name]"
 
 

e.g.

 # xinput list-props "Kensington Kensington Slimblade Trackball" Or # xinput list-props 11
Device 'Kensington Kensington Slimblade Trackball':
	Device Enabled (138):	1
	Coordinate Transformation Matrix (140):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	Device Accel Profile (264):	0
	Device Accel Constant Deceleration (265):	1.000000
	Device Accel Adaptive Deceleration (266):	1.000000
	Device Accel Velocity Scaling (267):	10.000000
	Device Product ID (258):	1149, 8257
	Device Node (259):	"/dev/input/event8"
	Evdev Axis Inversion (268):	0, 0
	Evdev Axes Swap (270):	0
	Axis Labels (271):	"Rel X" (148), "Rel Y" (149), "Rel Vert Wheel" (263)
	Button Labels (272):	"Button Left" (141), "Button Middle" (142), "Button Right" (143), "Button Wheel Up" (144), "Button Wheel Down" (145), "Button Horiz Wheel Left" (146), "Button Horiz Wheel Right" (147), "Button Side" (262), "Button Unknown" (261), "Button Unknown" (261), "Button Unknown" (261), "Button Unknown" (261)
	Evdev Scrolling Distance (273):	1, 1, 1
	Evdev Middle Button Emulation (274):	0
	Evdev Middle Button Timeout (275):	50
	Evdev Third Button Emulation (276):	0
	Evdev Third Button Emulation Timeout (277):	1000
	Evdev Third Button Emulation Button (278):	3
	Evdev Third Button Emulation Threshold (279):	20
	Evdev Wheel Emulation (280):	1
	Evdev Wheel Emulation Axes (281):	6, 7, 4, 5
	Evdev Wheel Emulation Inertia (282):	10
	Evdev Wheel Emulation Timeout (283):	200
	Evdev Wheel Emulation Button (284):	8
	Evdev Drag Lock Buttons (285):	0



Setting up "Kensington Kensington Slimblade Trackball"

xinput version 1.6.2

It seems in newer versions of xinput (used in Debian Stretch) use the options ScrollButton and ScrollMethod. Looking at the man page: [1] for inspiration I believe the below config will work.

Set up via xinput

xinput set-prop "Kensington Kensington Slimblade Trackball" "libinput Button Scrolling Button" 8
xinput set-prop "Kensington Kensington Slimblade Trackball" "libinput Scroll Method Enabled" 0, 0, 1

The first line is telling the xinput system use the upper-right button (Button 8 ) to trigger the navigation mode. The second line is to set the ScrollMethod method to button

I don't think this is quite the right way to do it but it works for me!


Via xorg.conf.d

Create a file called "23-Kensington_Slimblade_Trackball.conf" in your xorg.conf.d (on Debian Stretch /usr/share/X11/xorg.conf.d/23-Kensington_Slimblade_Trackball.conf) with the below content

Section "InputClass"
        Identifier      "Trackpoint Wheel Emulation"
        MatchProduct    "Kensington Kensington Slimblade Trackball"
        MatchDevicePath "/dev/input/event*"
        Option          "ScrollButton"          "8"
        Option          "ScrollMethod"          "button"
        Option          "XAxisMapping"          "6 7"
        Option          "YAxisMapping"          "4 5"
EndSection

Reload the udev rules

# udevadm control --reload-rules


xinput version ($OLDER)

Set up via xinput

xinput set-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation" 1
xinput set-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Button" 8
xinput set-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Axes" 6 7 4 5


The first line is telling the xinput system to enable the mouse wheel emulation (similar to the navigation mode) The second line is to use the upper-right button (Button 8 ) to trigger the navigation mode. The third line make it work for both vertical and horizontal scroll.


Deprecated method for the same

# xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation" 8 1
# xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Button" 8 8
# xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Axes" 8 6, 7, 4, 5


Via xorg.conf.d

a very much work in progress but this seems to be working


Some distributions now support the new Xorg hotplug configuration method via xorg.conf.d directories (in Ubuntu 10.04 Lucid Lynx) instead of hal. In contrast to the udev method below, it should be around for some time, so it might be the best way to “statically” configure scrolling.

Create the file /usr/share/X11/xorg.conf.d/23-Kensington_Slimblade_Trackball.conf as root with the following content:

 Some systems use /usr/lib/X11/xorg.conf.d instead
Section "InputClass"
	Identifier	"Trackpoint Wheel Emulation"
	MatchProduct	"Kensington Kensington Slimblade Trackball"
	MatchDevicePath	"/dev/input/event*"
	Option		"EmulateWheel"		"true"
	Option		"EmulateWheelButton"	"8"
	Option		"XAxisMapping"		"6 7"
	Option		"YAxisMapping"		"4 5"
EndSection


Reload the udev rules

# udevadm control --reload-rules



Additional reading and notes taken from


[2] [3] [4] [5]