LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-13-2006, 11:02 AM   #1
l0rddarkf0rce
Member
 
Registered: Nov 2004
Posts: 83

Rep: Reputation: 18
Select mouse at boot time


I'm running Slack 10.2 on a laptop and I would like to configure the mouse at boot time. If I have my usb mouse connected run gpm with the '-t imps2' option otherwise run it with the '-t ps2' option. Is there any way to check if the usb mouse is connected?

TIA for any help!
 
Old 03-13-2006, 11:35 AM   #2
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Don't know,maybe the option auto will work for both.
 
Old 03-13-2006, 12:22 PM   #3
l0rddarkf0rce
Member
 
Registered: Nov 2004
Posts: 83

Original Poster
Rep: Reputation: 18
nope it did not work
 
Old 03-13-2006, 12:29 PM   #4
piete
Member
 
Registered: Apr 2005
Location: Havant, Hampshire, UK
Distribution: Slamd64, Slackware, PS2Linux
Posts: 465

Rep: Reputation: 44
Yep, this should be very possible (I might have to try it on my laptop, it looks good!).

Reading the gpm man page here: http://www.die.net/doc/linux/man/man8/gpm.8.html

Indicates a -M option that will read multiple devices. Presumably, if your usb isn't plugged in, it'll just ignore it) but if it is, it'll work fine - you will need to test this.

The script you need to edit to make this work is: /etc/rc.d/rc.gpm

You may wish to back it up first, and don't forget you can always stop/start/restart it without rebooting by using the following options:

Code:
/etc/rc.d/rc.gpm stop
/etc/rc.d/rc.gpm start
/etc/rc.d/rc.gpm restart
Let us know how you get on!

- Piete.
 
Old 03-13-2006, 01:38 PM   #5
l0rddarkf0rce
Member
 
Registered: Nov 2004
Posts: 83

Original Poster
Rep: Reputation: 18
now based on this how do I redirect /dev/mouse to the appropriate device /dev/psaux or /dev/input/mice? my xorg.conf is pointing to /dev/mouse and if the link is not pointing to a working device it complains and dies.
 
Old 03-13-2006, 04:07 PM   #6
pdw_hu
Member
 
Registered: Nov 2005
Location: Budapest, Hungary
Distribution: Slackware, Gentoo
Posts: 346

Rep: Reputation: Disabled
rm /dev/mouse
ln -s /dev/whateveryouneed /dev/mouse

ln -s = to create symbolic links
 
Old 03-13-2006, 04:36 PM   #7
piete
Member
 
Registered: Apr 2005
Location: Havant, Hampshire, UK
Distribution: Slamd64, Slackware, PS2Linux
Posts: 465

Rep: Reputation: 44
In Xorg you can set both devices to run at once without using gpm at all if you set the builtin point to "AlwaysCore" and the USB to "SendCoreEvents".

Check here (http://www.die.net/doc/linux/man/man5/xorg.conf.5.html) for the man page of xorg.conf and here (http://www.kaear.co.uk/linux/xconf/XF86Config.laptop) for my laptop's current xorg.conf file.
 
Old 03-15-2006, 05:56 PM   #8
l0rddarkf0rce
Member
 
Registered: Nov 2004
Posts: 83

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by piete
In Xorg you can set both devices to run at once without using gpm at all if you set the builtin point to "AlwaysCore" and the USB to "SendCoreEvents".

Check here (http://www.die.net/doc/linux/man/man5/xorg.conf.5.html) for the man page of xorg.conf and here (http://www.kaear.co.uk/linux/xconf/XF86Config.laptop) for my laptop's current xorg.conf file.
Not working, but thanks for the suggestion... X will pick whichever device is marked as Mouse0 (even if it is not present). If I make /dev/psaux my Mouse0 then it never even tries to get to /dev/input/mice. Here is the mouse definitions from my /etc/X11/xorg.conf

Code:
Section "InputDevice
Identifier	"Mouse1"
Option		"ZAxisMapping" "4 5"
Driver		"mouse"
Option		"Protocol" "imps/2"
Option		"Device"  "/dev/input/mice"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
EndSection
All I want is that X picks a mouse when I boot and not crash when I boot the machine. For example...

Use my USB mouse if it is plugged (usually @ home or the office)
Use the glide mouse on the laptop when an USB mouse is not connected (in planes, etc)
 
Old 03-16-2006, 02:52 AM   #9
piete
Member
 
Registered: Apr 2005
Location: Havant, Hampshire, UK
Distribution: Slamd64, Slackware, PS2Linux
Posts: 465

Rep: Reputation: 44
Ok, I think you're Xorg.conf is probably incorrect if it's not working.

First of all, we're not writing Xorg.conf to "choose" a mouse, merely telling it to use more than one mouse. If I don't have my usb plugged in when I startx, it just gets ignored. If my usb *is* plugged in, then not only can I use my usb mouse, but also my trackpoint.

The steps to get this working are as follows:

1. Find your USB mouse device (/dev/input/mice ?) - cat /dev/input/mice and wiggle the device about to check it's correct.
2. Do the same with your touchpad (/dev/psaux ?)
3. Add both devices as separate inputdevices in your xorg.conf file (as above)
4. Edit your ServerLayout section to look similar to:

Code:
Section "ServerLayout"
Identifier     "MyLayout"
Screen      0  "Screen0" 0 0

InputDevice	"Mouse0" "CorePointer" # <-- This is the touchpad that should always be used
InputDevice	"Mouse1" "SendCoreEvents"  # <-- This will get used if it's around, but, doesn't matter if it's not!

InputDevice    "Keyboard0" "CoreKeyboard"
EndSection
If this still doesn't work you will have to post your entire Xorg.conf file to see what's missed.
 
Old 03-16-2006, 07:35 AM   #10
Panagiotis_IOA
Member
 
Registered: Jan 2006
Location: Hellas, Europe
Distribution: Slackware 12
Posts: 238

Rep: Reputation: 32
I changed my xorg.conf on InputDevice Section and ServerLayout and now KDE doesn't start. It gets stack on "Starting X11 session...". The problem is that I have runlevel 4 so KDE starts automatically and now I have no idea how I could get to shell to change from there my xorg.conf. Any suggestions?
 
Old 03-16-2006, 08:06 AM   #11
piete
Member
 
Registered: Apr 2005
Location: Havant, Hampshire, UK
Distribution: Slamd64, Slackware, PS2Linux
Posts: 465

Rep: Reputation: 44
If you boot into runlevel 3 while testing this stuff it's easy to fix if it doesn't work =)

However, since you're booting into 4, ctrl + alt + F6 will get you a standard login prompt. Login as root and type: init 3
This'll put you in runlevel 3 where you can use joe/jed/vi/vim/pico/nano (delete as appropriate) to edit xorg.conf.

When you've tweaked it a bit, run startx from some other TTY (as user, not root) and note the output of startx, it'll tell you what the problem is exactly (ok, it might be obfuscated a bit). The error messages will help us track down the issue.

- Piete.
 
Old 03-16-2006, 09:08 AM   #12
Panagiotis_IOA
Member
 
Registered: Jan 2006
Location: Hellas, Europe
Distribution: Slackware 12
Posts: 238

Rep: Reputation: 32
Well, I was looking at the output of error messages and there were some incorrect typings among the lines in xorg.conf like "End Section" instead of "EndSection". I edited to the original form and X started. Then I tried again to configure it, so my touchpad will be working and I had to change at the ServerLayout "Screen0" to "Screen1" and "Keyboard0" to "Keyboard1". Now everything works fine!
 
Old 03-16-2006, 09:42 AM   #13
piete
Member
 
Registered: Apr 2005
Location: Havant, Hampshire, UK
Distribution: Slamd64, Slackware, PS2Linux
Posts: 465

Rep: Reputation: 44
w00h00! *does the fixx0red groove*

Ooh yeah, ooh yeah ... *dances*

I'm glad it works for you, hope you learnt a lot

- Piete.
 
Old 03-16-2006, 02:58 PM   #14
l0rddarkf0rce
Member
 
Registered: Nov 2004
Posts: 83

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by piete
Ok, I think you're Xorg.conf is probably incorrect if it's not working.

First of all, we're not writing Xorg.conf to "choose" a mouse, merely telling it to use more than one mouse. If I don't have my usb plugged in when I startx, it just gets ignored. If my usb *is* plugged in, then not only can I use my usb mouse, but also my trackpoint.

The steps to get this working are as follows:

1. Find your USB mouse device (/dev/input/mice ?) - cat /dev/input/mice and wiggle the device about to check it's correct.
2. Do the same with your touchpad (/dev/psaux ?)
3. Add both devices as separate inputdevices in your xorg.conf file (as above)
4. Edit your ServerLayout section to look similar to:

Code:
Section "ServerLayout"
Identifier     "MyLayout"
Screen      0  "Screen0" 0 0

InputDevice	"Mouse0" "CorePointer" # <-- This is the touchpad that should always be used
InputDevice	"Mouse1" "SendCoreEvents"  # <-- This will get used if it's around, but, doesn't matter if it's not!

InputDevice    "Keyboard0" "CoreKeyboard"
EndSection
If this still doesn't work you will have to post your entire Xorg.conf file to see what's missed.

Dude a million thanks for your help and pacience! It works like a charm.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
wireless Keyboard not working to select boot options (Grub boot loader) psrini_vasan Fedora 7 12-16-2009 05:45 PM
ps2 mouse freezing on FC1/FC2 from time to time farpoint Linux - Hardware 5 08-14-2005 02:20 PM
time limit for select jhon Linux - Networking 1 09-08-2004 09:03 AM
Vim - select mode for mouse robertmarkbram Linux - Software 2 12-02-2003 08:23 PM
[suse kde3] mouse cannot select/click inside window ashley8 Linux - Hardware 0 09-25-2003 09:51 AM


All times are GMT -5. The time now is 09:23 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration