Which command to use to (temporarily) turn off the mouse?
Hi folks,
I've already googled for a solution to my problem, but to no avail. Is there any command that allows me to deactivate the mouse completely until I decide to turn it on again? My goal is to use xset dpms force off to shut off my display. However, even the slightest movement of the mouse causes it to turn on again. I'd like the system to do so only after a key is pressed. Thanks in advance for any replies, Gus |
My X setup uses /dev/input/mice - which means my USB trackball (preferred) or that horrible evil invention from the darkest depths of hell known as the 'touchpad'. Sometimes I can't plug in my trackball so I'll use the touchpad; however, most of the time when I boot that horrible touchpad screws me over because I bump it so often while typing.
So - the tricks are: 1. switch to a text virtual console (like vc1) 2. unload the mouse driver (for my cursed touchpad: rmmod psmouse) 3. do whatever you want to X Now before starting X, just remember to activate the mouse driver again; do this from the text console just in case X gets a bit confused (although it shouldn't if you use 'mice' as I do). |
Hi pinniped,
thanks very much for your fast reply. It completely deactives my notebook's touchpad. But how do I proceed if I want to do the same with an USB mouse? After all, I cant' just unload the whole usbhid module, can I? lsusb (debian) delivers: Quote:
I already tried the approach mentioned in the link above: http://www.linuxquestions.org/questi...ff-usb-509328/. However, in the directory Quote:
Quote:
Quote:
|
For the USB mouse, I set up 'udev' to always call it 'mouse0' (and the touchpad is always mouse1). I just pull out the USB mouse and plug it back in. You *have* to be in a virtual console when you plug the mouse back in, otherwise X has the mouse device open and udev can't name the mouse 'mouse0'; also, you don't want a million mouse devices which don't really exist because the USB mouse was plugged and unplugged multiple times - that would be a mouse infestation.
I don't have my laptop with me today so I can't look up the rule I used (and where I put it), but you start off with the /sys filesystem: cd /sys/class/input udevinfo -a -p $PWD/mouse0 Somewhere in there I get: ATTRS{name}=="PS2++ Logitech TrackMan" SO I can make a udev rule: KERNEL=="mouse?", ATTRS{name}=="PS2++ Logitech TrackMan", NAME="mouse0" |
Quote:
The grand goal was to write a shell script that first turns the mouse off via command and then does the same with the display. Besides, plugging the mouse in and out already works fine somehow. |
I can't think of how to disable the mouse without disabling keyboards as well. Unfortunately it looks like time to look at the driver code. It might be possible to write to a sysfs parameter to shut down the mouse. Otherwise the only other option I can think of is to have an enable/disable parameter in sysfs - that may be useful if other people have the same problem and find it too annoying.
|
Oh. I think that right now this is way over my head. I guess I'll just have to stick with plugging the mouse in and out.
Thanks for your efforts though, pinniped. |
All times are GMT -5. The time now is 04:18 PM. |