LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-16-2008, 02:47 AM   #1
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware current
Posts: 423

Rep: Reputation: 73
off mice and mouse


My laptop has a touchpad and there's no way to switch the trackpad on and off via the hardware.

So to avoid random, possibly destructive palm-swipes, I set up xorg.conf so that the trackpad was off when my usb mouse was present. In slackware 11 I achieved this with:

Code:
Section "InputDevice"
    Identifier  "MouseTouchPad"
    Driver      "mouse"
    Option "Protocol"    "Auto"
    Option "Device"      "/dev/mouse"
EndSection
and pointing the /dev/mouse symlink to /dev/input/mouse0, which was the USB mouse, if connected, or, if not, the trackpad. Hence no need to ever edit xorg.conf. Lovely

In slackware 12.1 this no longer works as the trackpad is always mouse1 and usb mouse is always mouse2. mouse0 isn't anything (there's no ps2 socket?). I can see why this makes sense - perhaps my slack 11 method was a bit of kludge really.

So at present I've got to remember to edit xorg.conf or use layouts depending whether my USB mouse is connected or not. Is there a better way that would get me back to what I had in slack 11?
 
Old 08-16-2008, 03:02 AM   #2
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Rep: Reputation: 30
even better...

udev is a way of managing linux devices accessed via /dev filesystem. it incorporates rules and simple progmatic decision making to create /dev/xxx files. you can use this to create /dev files that are different depending on whether your mouse is connected or not, and its all automatic once you have set it up. no editing thereafter!


simply create a udev rule (/etc/udev/rules.d) to setup the symlinks in the /dev dir when you mouse is connected (or not).

http://reactivated.net/writing_udev_rules.html

of course, if you are not using udev then install and use it
 
Old 08-17-2008, 12:30 PM   #3
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware current
Posts: 423

Original Poster
Rep: Reputation: 73
thanks keratos - udev is indeed the way to go.

I installed the synaptics driver from slackbuilds.org and followed the instructions/READMEs carefully.

Then I created /etc/udev/rules.d/90-local.rules with these rules:

Code:
ACTION=="add", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=1"
ACTION=="remove", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=0"
I found them here:
http://www.freesoftwaremagazine.com/...max?page=0%2C1

And now plugging in the usb mouse switches off the trackpad and vice-versa.

Very happy
 
Old 08-17-2008, 01:18 PM   #4
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware current
Posts: 423

Original Poster
Rep: Reputation: 73
Just hit an annoyance: if I start my laptop up from scratch with the usb mouse plugged in then the trackpad still works. I have to either do synclient TouchpadOff=1 manually or unplug and plug the mouse.
 
Old 08-17-2008, 03:29 PM   #5
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Rep: Reputation: 30
well done.

so far as booting with mouse plugged in, I think you need to change the way you run your rule. ADD/REMOVE is an event, I am not convinced these events are triggered unless a change of state occurs. i.e. if you boot up with a device, the event is only triggered once you remove a device, or plug it in. this behavior is what you are seeing.

rather than ADD/REMOVE try some logic like ...

<enable the touchpad by default at system start>
<IF mouse device loaded THEN>
<disable touchpad>
<ENDIF>

there are many ways to start touchpad at system start, if not already done so.

it is possible to use the following to disable touchpad if a mouse driver is loaded

KERNEL=="mouse0", RUN+="/usr/bin/synclient TouchpadOff=1"

note that mouse0 may be different on your system. to confirm if mouse0 is your interface to the mouse, then try

# udevinfo -a -p /sys/class/input/mouse0

udev and the kernel communicate via something called 'sysfs' or /sys to you+me. All devices managed by udev can be interrogated by using appropriate interfaces under /sys

so, you should get something like


looking at device '/class/input/input0/mouse0':
KERNEL=="mouse0"
SUBSYSTEM=="input"
DRIVER==""
ATTR{dev}=="13:32"

looking at parent device '/class/input/input0':
KERNELS=="input0"
SUBSYSTEMS=="input"
DRIVERS==""
ATTRS{name}=="Macintosh mouse button emulation"
ATTRS{phys}==""
ATTRS{uniq}==""
ATTRS{modalias}=="input:b0017v0001p0001e0100-e0,1,2,k110,111,112,r0,1,amlsfw"

if not, try other devices under /sys/class/input/* until you find it.

check out the KERNEL== line. this should be put into the udev rule as above.

this should be better than ADD/REMOVE

Last edited by keratos; 08-17-2008 at 03:30 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xwindows trouble -no /dev/mouse /dev/input/mice fatblueduck Linux - General 2 06-05-2005 11:03 PM
USB mouse loaded but no /dev/input/mice output paul167 Linux - Hardware 8 02-16-2005 02:24 AM
xmodmap for multiple mice? external and laptop mice scrolling back/forward, etc. bleargh Linux - Software 3 12-31-2004 08:48 AM
Can I use two mice??? harrkev Linux - General 3 06-15-2004 11:52 PM
Usb mice troubles, mouse works, but it jitters? help? nakedpretzel Linux - Hardware 1 02-23-2004 12:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration