Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
changing my mouse without restarting
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
kamagurka
Veteran
Veteran


Joined: 25 Jan 2004
Posts: 1026
Location: /germany/munich

PostPosted: Wed Jun 16, 2004 3:43 pm    Post subject: changing my mouse without restarting Reply with quote

i have purchased a new mouse. i am not yet sure how i'm gonna hook it up (usb or ps/2), but 'd like to switch without rebooting and preferrably also without restarting the xserver.

1. how do i make linux (or the xserver) reload the ps/2 port should i choose to put my new mouse there (my old one is there too).
2. how do i switch X over to taking the mouse input from the usb port instead of the ps/2 port (without restarting it)? can it be done?
_________________
If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word
Back to top
View user's profile Send private message
rmalolepszy
Apprentice
Apprentice


Joined: 01 Jan 2004
Posts: 167

PostPosted: Wed Jun 16, 2004 3:59 pm    Post subject: Reply with quote

Be careful doing this. Old motherboards would short if you pulled the mouse while it was powered on. Any non-hotplug device really has this issue because of the sudden change in voltage (although a mouse doesn't use much).

I'm not really sure about kililng x and restarting it (without looking - i'm at work). That's in essence what you need to do. I know in X you can ctrl-alt-backspace to restart x (re-reading the config).
_________________
Cheers,
Ryan
Back to top
View user's profile Send private message
kamagurka
Veteran
Veteran


Joined: 25 Jan 2004
Posts: 1026
Location: /germany/munich

PostPosted: Wed Jun 16, 2004 4:19 pm    Post subject: Reply with quote

well, this mobo isn't *that* old.
good tip about the ctrl+alt+backsp. didnt know that.
_________________
If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word
Back to top
View user's profile Send private message
hermes_jr
l33t
l33t


Joined: 26 Feb 2004
Posts: 701
Location: Moscow, Russia

PostPosted: Wed Jun 16, 2004 4:32 pm    Post subject: Reply with quote

Code:

# rmmod hid
# modprobe hid

Should work if mouse support is compiled as a standalone module and module unloading is supported (also a kernel option)... In theory :roll:.
Back to top
View user's profile Send private message
rmalolepszy
Apprentice
Apprentice


Joined: 01 Jan 2004
Posts: 167

PostPosted: Wed Jun 16, 2004 4:33 pm    Post subject: Reply with quote

BTW, you should just be able to kill your X process then start it back up with 'startx' or something similar to re-read your config.
_________________
Cheers,
Ryan
Back to top
View user's profile Send private message
kamagurka
Veteran
Veteran


Joined: 25 Jan 2004
Posts: 1026
Location: /germany/munich

PostPosted: Wed Jun 16, 2004 5:36 pm    Post subject: Reply with quote

rmalolepszy wrote:
BTW, you should just be able to kill your X process then start it back up with 'startx' or something similar to re-read your config.


well, duh. i would like to be able to do it without resorting to this.
_________________
If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54808
Location: 56N 3W

PostPosted: Wed Jun 16, 2004 6:19 pm    Post subject: Reply with quote

Kamagurka,

Connect your new mouse as USB and leave your old mouse connected too. Then configure X to use both. whichever one you pick up will work.

PS/2 ports are not hot pluggable by design. Tou may break your port and/or mouse if you try.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
474
l33t
l33t


Joined: 19 Apr 2002
Posts: 714

PostPosted: Wed Jun 16, 2004 7:02 pm    Post subject: Reply with quote

On a similar note, X will handle the hotplugging of USB mice provided that you choose to use the /dev/input/mice node in the configuration file. Otherwise, if you unplug the mouse then plug one back in again then the pointer will remain motionless until X is restarted!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54808
Location: 56N 3W

PostPosted: Wed Jun 16, 2004 7:12 pm    Post subject: Reply with quote

kerframil,

If you use /dev/input/mouse0 for your USB mouse rather than /dev/input/mice you have to wait for the system to dectect that the mouse has been uplugged before you plugit back in again, or it will be detected as /dev/input/mouse1 (mouse0 still exists). That can be 20 seconds or more.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
474
l33t
l33t


Joined: 19 Apr 2002
Posts: 714

PostPosted: Wed Jun 16, 2004 7:13 pm    Post subject: Reply with quote

Interesting. I've not been struck by that phenomenon but I'll certainly check it out. Presumably /dev/input/mice maintains a valid link to the most recently activated mouse device.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54808
Location: 56N 3W

PostPosted: Wed Jun 16, 2004 7:23 pm    Post subject: Reply with quote

kerframil,

/dev/input/mice gets all the commads from all connected mice.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
474
l33t
l33t


Joined: 19 Apr 2002
Posts: 714

PostPosted: Wed Jun 16, 2004 7:26 pm    Post subject: Reply with quote

Well, how about that (crosses off "learn something new" on the list of things to do) ... ;)
Back to top
View user's profile Send private message
forbjok
Apprentice
Apprentice


Joined: 21 May 2004
Posts: 207
Location: Hordaland, Norge

PostPosted: Fri Jun 18, 2004 9:01 am    Post subject: Reply with quote

I switch my usb mice (yeah, I have several, depending on where i am) between my laptop and other computers all the time, and I've never had to restart X because of it. With 2.6 kernels, /dev/mouse (-> /dev/psaux?) seems to merge all connected ps2/usb mice into a single device, so you don't even have to have seperate X configurations for them.

I don't remember having trouble with X detecting PS/2 mice on unplug/replug either (in fact, in one case re-plugging it fixed the "cursor-jumping-randomly-all-over-the-screen" problem without restarting X), but then again I rarely use PS/2 mice.

Supposedly, hotplugging PS/2 devices can damage the motherboard and/or devices, but I've done it a hundred times myself with both keyboards and mice, and nothing ever happened :lol:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum