Difference between revisions of "Mouse Disable"
m (Created page with 'Category:Engineering == disable a mouse under X11 == List input devices to find the '''id''' of the mouse to disable. In this example I will disable '''id=12'''. <pre> xinp…') |
|||
Line 24: | Line 24: | ||
− | List details for mouse id=12. Notice the first property, '''Device Enabled (132)'''. The number in parentheses, '''132''', is the property id we are interested in. | + | List details for mouse id=12. Notice the first property, '''Device Enabled (132)'''. The number in parentheses, '''132''', is the property id we are interested in. '''You can also specify the property by name.''' This will be shown after the example below. |
<pre> | <pre> | ||
xinput --list-props 12 | xinput --list-props 12 | ||
Line 54: | Line 54: | ||
</pre> | </pre> | ||
− | Disable property '''132''' for mouse '''12''': | + | Disable property id '''132''' for mouse '''12''': |
<pre> | <pre> | ||
xinput --set-prop 12 132 0 | xinput --set-prop 12 132 0 | ||
Line 62: | Line 62: | ||
xinput --set-prop 12 132 1 | xinput --set-prop 12 132 1 | ||
</pre> | </pre> | ||
− | When the mouse is disabled it will not move the cursor in X11, but you can see that the HID driver still reads the device by dumping the output of the mouse's device node. Note the '''Device Node (250)''' property listed in the property list. This shows the location of the device file. You can dump the | + | |
+ | You can also change the property by name instead of using the property id. | ||
+ | <pre> | ||
+ | xinput --set-prop 12 "Device Enabled" 0 | ||
+ | xinput --set-prop 12 "Device Enabled" 1 | ||
+ | </pre> | ||
+ | |||
+ | When the mouse is disabled it will not move the cursor in X11, but you can see that the HID driver still reads the device by dumping the output of the mouse's device node. Note the '''Device Node (250)''' property listed in the property list. This property is not always available on every system, but if it is shown then this shows the location of the input device file. You can dump the raw events of the input device with the following command. | ||
<pre> | <pre> | ||
sudo od -x /dev/input/event9 | sudo od -x /dev/input/event9 |
Latest revision as of 19:06, 11 September 2012
disable a mouse under X11
List input devices to find the id of the mouse to disable. In this example I will disable id=12.
xinput --list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ SynPS/2 Synaptics TouchPad id=14 [slave pointer (2)] ⎜ ↳ TPPS/2 IBM TrackPoint id=15 [slave pointer (2)] ⎜ ↳ Microsoft Microsoft Basic Optical Mouse id=10 [slave pointer (2)] ⎜ ↳ Microsoft Compact Optical Mouse 500 id=12 [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)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Integrated Camera id=9 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=13 [slave keyboard (3)] ↳ ThinkPad Extra Buttons id=16 [slave keyboard (3)] ↳ Chicony PFU-65 USB Keyboard id=11 [slave keyboard (3)]
List details for mouse id=12. Notice the first property, Device Enabled (132). The number in parentheses, 132, is the property id we are interested in. You can also specify the property by name. This will be shown after the example below.
xinput --list-props 12 Device 'Microsoft Compact Optical Mouse 500': Device Enabled (132): 1 Coordinate Transformation Matrix (134): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 Device Accel Profile (254): 0 Device Accel Constant Deceleration (255): 1.000000 Device Accel Adaptive Deceleration (256): 1.000000 Device Accel Velocity Scaling (257): 10.000000 Device Product ID (249): 1118, 1847 Device Node (250): "/dev/input/event9" Evdev Axis Inversion (258): 0, 0 Evdev Axes Swap (260): 0 Axis Labels (261): "Rel X" (142), "Rel Y" (143), "Rel Vert Wheel" (253) Button Labels (262): "Button Left" (135), "Button Middle" (136), "Button Right" (137), "Button Wheel Up" (138), "Button Wheel Down" (139), "Button Horiz Wheel Left" (140), "Button Horiz Wheel Right" (141) Evdev Middle Button Emulation (263): 0 Evdev Middle Button Timeout (264): 50 Evdev Third Button Emulation (265): 0 Evdev Third Button Emulation Timeout (266): 1000 Evdev Third Button Emulation Button (267): 3 Evdev Third Button Emulation Threshold (268): 20 Evdev Wheel Emulation (269): 0 Evdev Wheel Emulation Axes (270): 0, 0, 4, 5 Evdev Wheel Emulation Inertia (271): 10 Evdev Wheel Emulation Timeout (272): 200 Evdev Wheel Emulation Button (273): 4 Evdev Drag Lock Buttons (274): 0
Disable property id 132 for mouse 12:
xinput --set-prop 12 132 0
And to eable the mouse again:
xinput --set-prop 12 132 1
You can also change the property by name instead of using the property id.
xinput --set-prop 12 "Device Enabled" 0 xinput --set-prop 12 "Device Enabled" 1
When the mouse is disabled it will not move the cursor in X11, but you can see that the HID driver still reads the device by dumping the output of the mouse's device node. Note the Device Node (250) property listed in the property list. This property is not always available on every system, but if it is shown then this shows the location of the input device file. You can dump the raw events of the input device with the following command.
sudo od -x /dev/input/event9 0000000 4d61 5024 0000 0000 3b39 0007 0000 0000 0000020 0002 0001 0001 0000 4d61 5024 0000 0000 0000040 3b3f 0007 0000 0000 0000 0000 0000 0000 0000060 4d61 5024 0000 0000 541e 0008 0000 0000 0000100 0002 0000 ffff ffff 4d61 5024 0000 0000 ...