xinput(1) — Linux man page
xinput is a utility to list available input devices, query information about a device and change input device settings.
Options
—version Test if the X Input extension is available and return the version number of the program and the version supported by the server. This option does not require a device name. —list [—short || —long || —name-only || —id-only] [device] If no argument is given list all the input devices. If an argument is given, show all the features of device. If —long is provided, the output includes detailed information about the capabilities of each devices. Otherwise, or if —short is provided, only the device names and some minimal information is listed. If —name-only is provided, the output is limited to the device names. One device name is listed per line. Note that the order the devices are listed is undefined. If —id-only is provided, the output is limited to the device IDs. One device ID is listed per line. Note that the order the devices are listed is undefined. —get-feedbacks device Display the feedbacks of device. —set-pointer device Switch device in core pointer. This option does nothing on X servers 1.5 and later. —set-mode device ABSOLUTE|RELATIVE Change the mode of device. —set-ptr-feedback device threshold num denom Change the pointer acceleration (or feedback) parameters of device. The xset(1) man page has more details. For X.Org Server 1.7 and above, there are additional device properties pertaining to pointer acceleration. These do not replace, but complement the pointer feedback setting. —set-integer-feedback device index value Change the value of an integer feedback of device. —set-button-map device map_button_1 [map_button_2 [. ]] Change the button mapping of device. The buttons are specified in physical order (starting with button 1) and are mapped to the logical button provided. 0 disables a button. The default button mapping for a device is 1 2 3 4 5 6 etc. —query-state device Query the device state. —list-props device [device [. ]] Lists properties that can be set for the given device(s). —set-int-prop device property format value Sets an integer property for the device. Appropriate values for format are 8, 16, or 32, depending on the property. Deprecated, use —set-prop instead. —set-float-prop device property value Sets a float property for the device. Deprecated, use —set-prop instead. —set-prop [—type=atom|float|int] [—format=8|16|32] device property value [. ] Set the property to the given value(s). If not specified, the format and type of the property are left as-is. The arguments are interpreted according to the property type. —watch-props device Prints to standard out when property changes occur. —delete-prop device property Delete the property from the device. —test [-proximity] device Register all extended events from device and enter an endless loop displaying events received. If the -proximity is given, ProximityIn and ProximityOut are registered. —test-xi2 [device] Register for a number of XI2 events and display them. If a device is given, only events on this device are displayed. —create-master prefix [sendCore] [enable] Create a new pair of master devices on an XI2-enabled server with the given prefix. The server will create one master pointer named «prefix pointer» and one master keyboard named «prefix keyboard». If sendCore is 1, this pair of master devices is set to send core events (default). If enable is 1, this master device pair will be enabled immediately (default). —remove-master master [Floating|AttachToMaster] [returnPointer] [returnKeyboard] Remove master and its paired master device. Attached slave devices are set floating if Floating is specified or the argument is omitted. If the second argument is AttachToMaster, returnPointer specifies the master pointer to attach all slave pointers to and returnKeyboard specifies the master keyboard to attach all slave keyboards to. —reattach slave master Reattach slave to master. —float slave Remove slave from its current master device. —set-cp window master Set the ClientPointer for the client owning window to master. master must specify a master pointer. —map-to-output device crtc Restricts the movements of the absolute device to the RandR crtc. The output name must match a currently connected output (see xrandr(1)). If the NVIDIA binary driver is detected or RandR 1.2 or later is not available, a Xinerama output may be specified as «HEAD-N», with N being the Xinerama screen number. This option has no effect on relative devices. —enable device Enable the device. This call is equivalent to xinput —set-prop device «Device Enabled» 1 —disable device Disable the device. This call is equivalent to xinput —set-prop device «Device Enabled» 0
device can be the device name as a string or the XID of the device.
slave can be the device name as a string or the XID of a slave device.
master can be the device name as a string or the XID of a master device.
property can be the property as a string or the Atom value.
See Also
Copyright
Copyright 2007, Peter Hutterer.
Copyright 2008, Philip Langdale.
Copyright 2009-2011, Red Hat, Inc.
Ubuntu Wiki
Ubuntu supports input-hotplug. With this functionality, it’s likely that you won’t need to do any configuration at all to make your devices work, assuming they’re recognized and set up by the kernel. However, if you do need to do adjust things, read on.
Dynamic Input Configuration with xinput
The xinput command line tool can be used for some on-the-fly configuration adjustments.
To view a listing of the input devices X sees, run:
$ xinput list ⎡ Virtual core pointer [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer [slave pointer (2)] ⎜ ↳ SynPS/2 Synaptics TouchPad [slave pointer (2)] ⎜ ↳ Logitech USB Receiver [slave pointer (2)] ⎣ Virtual core keyboard [master keyboard (2)] ↳ Virtual core XTEST keyboard [slave keyboard (3)] ↳ Power Button [slave keyboard (3)] ↳ Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint [slave keyboard (3)]
Individual devices can be queried for more details by using the numerical id or the name:
$ xinput query-state 9 2 classes : 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 button[14]=up button[15]=up button[16]=up button[17]=up button[18]=up button[19]=up button[20]=up button[21]=up button[22]=up button[23]=up button[24]=up ValuatorClass Mode=Relative Proximity=In valuator[0]=66 valuator[1]=925
xinput can also be used to alter the button mappings on mice and adjust the acceleration and feedback settings.
Different input drivers may also expose arbitrary properties for applications to set. Synaptics touchpads are particularly configurable like this, but other devices have some more general properties.
$ xinput list-props 8 Device 'SynPS/2 Synaptics TouchPad': Device Enabled: 1 Synaptics Edges: 1632, 5312, 1575, 4281 Synaptics Finger: 25, 30, 256 Synaptics Tap Time: 180 Synaptics Tap Move: 220 Synaptics Tap Durations: 180, 180, 100 Synaptics Tap FastTap: 0 [. ] $ xinput set-int-prop 8 "Device Enabled" 8 0 $ xinput list-props 8 Device 'SynPS/2 Synaptics TouchPad': Device Enabled: 0 Synaptics Edges: 1632, 5312, 1575, 4281 Synaptics Finger: 25, 30, 256 Synaptics Tap Time: 180 Synaptics Tap Move: 220 Synaptics Tap Durations: 180, 180, 100 Synaptics Tap FastTap: 0 [. ]
Input Configuration with InputClass sections
To set e.g. the Coordinate Transformation Matrix in an xorg.conf type file (e.g., /etc/X11/xorg.conf.d/90-rotate-screen.conf), set the «TransformationMatrix» option (NOT "CoordinateTransformationMatrix" or "Coordinate Transformation Matrix". ) in an InputDevice or InputClass section; for example:
Section "InputClass" Identifier "RotateTouchCW" MatchProduct "N-Trig MultiTouch" Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1" EndSection
Example: Disabling middle-mouse button paste on a scrollwheel mouse
Scrollwheel mice support a middle-button click event when pressing the scrollwheel. This is a great feature, but you may find it irritating. Fortunately it can be disabled.
First, you need to know the id of the mouse, like this:
$ xinput list | grep 'id=' "Virtual core pointer" [XPointer] "Virtual core keyboard" [XKeyboard] "AT Translated Set 2 keyboard" [XExtensionKeyboard] "Macintosh mouse button emulation" [XExtensionPointer] "Logitech USB-PS/2 Optical Mouse" [XExtensionPointer]
My mouse has the Logitech logo printed on it, so I gather I need the last entry.
I can view the current button mapping thusly:
$ xinput get-button-map 4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 10
Really, only the first three numbers have meaning for me. They represent the left, middle, and right mouse buttons.
I can turn the middle mouse button off by setting it to 0:
$ xinput set-button-map 4 1 0 3
Or I can turn the middle-mouse button into a left-mouse button by setting it to 1:
$ xinput set-button-map 4 1 1 3
To make this set on a per-user basis, I can plug that line into my ~/.xstartup or other init file. It can also be done via configuring a matching InputClass section on xorg.conf.
Contributed Documentation
- General Multimedia keyboard — Probably out of date as of Intrepid due to input-hotplug
- USB keyboard — Probably out of date as of Intrepid due to input-hotplug
- Apple Keyboard — Probably out of date as of Intrepid due to input-hotplug
- Microsoft Natural Ergonomic 4000 keyboard — Probably obsolete
- Logitech G15 keyboard — Probably obsolete
- General Multi-Button mouse
- Bluetooth input devices
- Intellimouse Mouseman buttons — Probably obsolete
- Logitech MX1000 mouse
- Logitech G7 mouse
- Logitech MX610 mouse
- Razer CopperHead mouse
- Serial mouse
- Logitech Marble Mouse USB — hal fdi policy for Intrepid
Don’t Zap
Using GNOME
- Get to the System->Preferences->Keyboard menu.
- Select the «Layouts» tab and click on the «Options» button.
- Then select «Key sequence to kill the X server» and enable «Control + Alt + Backspace».
If this doesn’t work (e.g. the option is unchecked but the key sequence still works), you can edit your /etc/X11/xorg.conf as explained below
Using KDE
- Open System Settings and go to Input Devices.
- In the Keyboard section open the Advanced tab.
- Check the Configure keyboard options box if it’s not already enabled.
- Expand the Key sequence to kill the X server option and check the box labelled Control + Alt + Backspace.
- Make sure to click the Apply button to apply the changes.
Using the command line
You can type the following command to enable Zapping immediately.
setxkbmap -option terminate:ctrl_alt_bksp
If you’re happy with the new behaviour you can add that command to your ~/.xinitrc in order to make the change permanent.
Sticky Keys
It may be worth mentioning that the Accessibility shortcuts (for both KDE and Gnome) are enabled by holding the shift-key for 8 seconds. (This is easy to do if, say, selecting multiple items with the mouse). As a result, it’s easy to inadvertently enable «Sticky Keys». Now, if you press Ctrl and then release it, and a bit later, you press Alt-Bksp (the shortcut to delete a whole word), then Boom! Bye-bye X-session Sad
Also, unlike Ctrl-Alt-Del, the Ctrl-Alt-Bksp shortcut is not trapped. It’s instant death (without confirmation) for the X-server, and too bad about your unsaved files. That’s why DontZap is a good default.
For anyone missing the ability to kill the X-server in emergency, may I point out Alt-SysRq-R, followed by Ctrl-Alt-F1 (the first puts the keyboard back into Raw mode, i.e. outside the control of the X-server; the latter switches Virtual Terminal.) Or you can use Alt-SysRq-K to kill the current session.
X/Config/Input (последним исправлял пользователь 027edfa5 2012-12-21 12:38:00)