MOUSE AUTODETECTION: NEED FEEDBACK FROM EVERYBODY

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

MOUSE AUTODETECTION: NEED FEEDBACK FROM EVERYBODY

#1 Post by BarryK »

Everybody who is running Puppy that is!

I'm working on mouse autodetection.
Detection of the USB mouse is fine.

I was doing some research on how to detect a PS/2 mouse, came across a little
bit of information that the PS/2 mouse always uses interrupt 12.
The interrupt assignments are shown /proc/interrupts, that you can open with
a text editor.

True enough, when using my PS/2 mouse, I see this line in /proc/interrupts:

Code: Select all

 12:       2833          XT-PIC  PS/2 Mouse
On the other hand, using my USB mouse (with PS/2 mouse unplugged):

Code: Select all

 12:          0          XT-PIC  SiS 7012
...something else has grabbed that interrupt.

Question 1
But, I need to know that this behaviour is consistent on other PCs.
If you are using a PS/2 mouse, do you get that text string "PS/2 Mouse"
alongside the interrupt 12 line?
If you are using a USB or serial mouse, do you not get that string?

Question 2
What order should mouses be detected?
Should I check for a USB mouse first, as many people will have an external
USB mouse on their laptop and they will want it to override the internal
one?
If there is no USB mouse, then I'll check for PS/2 mouse, failing that, could
just assume it's serial ...as I don't yet have a surefire serial detection method.

raffy
Posts: 4798
Joined: Wed 25 May 2005, 12:20
Location: Manila

Report of /proc/interrrupts

#2 Post by raffy »

People reporting on what they have in /proc/interrupts can help a lot here.

Yes, in my Celeron 400, it is

Code: Select all

12:      29451          XT-PIC  PS/2 Mouse
Will check on one Puppy PC with serial mouse in the office tomorrow.

As to the order, the surest detection should be first (ps/2 as of now), then if it fails, the user may be asked to key in additional information. :?: But I guess am mostly a desktop user - laptop users may want USB to be detected first. So perhaps if it's a laptop, it should be USB first.
Last edited by raffy on Wed 05 Apr 2006, 12:25, edited 1 time in total.

User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#3 Post by Ted Dog »

Code: Select all

 12:     200078          XT-PIC  PS/2 Mouse

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#4 Post by jcoder24 »

I have a usb mouse and mine looks like this

Code: Select all

 12:          0          XT-PIC  usb-ohci, au8820
I agree with your order of autodection USB, PS/2, Serial.

keenerd
Posts: 176
Joined: Sat 20 Aug 2005, 19:24

#5 Post by keenerd »

My thinkpad's trackpoint:

12: 33749 XT-PIC PS/2 Mouse

The laptop also has an external PS/2 port, using the gives the identical:

12: 39431 XT-PIC PS/2 Mouse

(Minor aside, when using an external scroll wheel mouse, the wheel causes the cursor to leap up or down the screen. Since my laptop doesn't have a scroll wheel, it could have been always doing this and I could never tell. Odd, huh?)

Just out of curiosity, what does that "CPU0" column do? It seems to only increase over time.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#6 Post by Lobster »

CPU0
0: 2606853 XT-PIC timer
1: 21838 XT-PIC keyboard
2: 0 XT-PIC cascade
8: 0 XT-PIC rtc
10: 0 XT-PIC via82cxxx
11: 32557 XT-PIC acpi, usb-uhci, usb-uhci, eth0
12: 594962 XT-PIC PS/2 Mouse
14: 12823 XT-PIC ide0
15: 690 XT-PIC ide1
NMI: 0
ERR: 0

I am using SimplePup with generic PS2 scroll mouse
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
pakt
Posts: 1157
Joined: Sat 04 Jun 2005, 16:54
Location: Sweden

#7 Post by pakt »

EDIT: I think I need to have my eyes examined :oops: I read Barry's post wrong. My results are consistent with his thinking: I'm using a USB mouse and therefore interrupt 12 is not being used for a PS/2 mouse - in fact it's not used at all. :D

As Barry said, USB detection already works.
----------------------------------------------------
Barry, sorry to rain on your parade, but using Puppy 107 and a usb mouse & keyboard on my laptop I get:

Code: Select all

  0:    2071497          XT-PIC  timer
  1:          6          XT-PIC  keyboard
  2:          0          XT-PIC  cascade
  7:          0          XT-PIC  Intel ICH4
  8:          0          XT-PIC  rtc
  9:          2          XT-PIC  acpi
 11:     229084          XT-PIC  ehci_hcd, usb-uhci, usb-uhci, usb-uhci, Texas Instruments PCI4510 PC card Cardbus Controller, ehci_hcd, eth0
 14:      10662          XT-PIC  ide0
 15:         82          XT-PIC  ide1
Just to be clear, the mouse and keyboard are connected to the laptop through a 2-port bus-powered USB hub.

lsmod shows:

Code: Select all

Module                  Size  Used by    Not tainted
keybdev                 1860   0  (unused)
mousedev                4020   1 
hid                    20804   0  (unused)
usbmouse                1880   0  (unused)
usbkbd                  2904   0  (unused)
input                   3360   0  [keybdev mousedev hid usbmouse usbkbd]
EDIT: I found this that may help:

Code: Select all

# cat /proc/bus/usb/devices | grep -i usb
S:  Product=USB UHCI Root Hub
S:  Product=USB UHCI Root Hub
S:  Product=USB UHCI Root Hub
S:  Product=Intel Corp. 82801DB USB2
S:  Product=USB-PS/2 Optical Mouse
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbmouse
S:  Product=USB Keyboard
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbkbd
#
or:

Code: Select all

# cat /proc/bus/usb/drivers 
         usbdevfs
         hub
         usbkbd
         usbmouse
 96-111: hiddev
         hid
  0- 15: usblp
         serial
#
Both of these detect the usb mouse and keyboard.
NB: the "serial" in the list above is a USB-to-serial adapter I use with the laptop to talk to a controller board.

Search order (if possible): USB, PS/2 then serial
Paul
Last edited by pakt on Wed 05 Apr 2006, 18:07, edited 2 times in total.

krumpli
Posts: 32
Joined: Tue 06 Dec 2005, 17:27
Location: Florida USA

#8 Post by krumpli »

here is my /proc/interrupts:
CPU0
0: 77833 XT-PIC timer
1: 179 XT-PIC keyboard
2: 0 XT-PIC cascade
3: 24803 XT-PIC usb-uhci
5: 0 XT-PIC usb-uhci, Intel ICH5
8: 0 XT-PIC rtc
10: 0 XT-PIC usb-uhci, usb-uhci
11: 3635 XT-PIC ehci_hcd, eth0
14: 9604 XT-PIC ide0
15: 56 XT-PIC ide1
NMI: 0
ERR: 0
when I ran cat /proc/bus/usb/devices | grep -i usb (as per pakt) my results:
# cat /proc/bus/usb/devices | grep i -usb
242:S: SerialNumber=ec00
303:I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
657:S: SerialNumber=e800
718:I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
1072:S: SerialNumber=e400
1133:I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
1311:D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
1504:I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbmouse
1862:S: SerialNumber=e000
1923:I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
2247:S: Manufacturer=Linux 2.4.29 ehci_hcd
2323:S: SerialNumber=00:1d.7
2387:I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
2565:D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
2693:S: Product=Winter Ver1.3
2722:S: SerialNumber=404946475856
2791:I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none)
#


I am using pup1.08 with a USB 2 button & scroll wheel mouse. Keyboard is attached to ps/2 input. Hope this helps.[/list]

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#9 Post by Pizzasgood »

Code: Select all

  1:         53          XT-PIC  keyboard

Code: Select all

12:      20760          XT-PIC  PS/2 Mouse
with my wireless optical mouse and keyboard combo, which has one normal ps/2 plug and a usb plug going through an adapter into a normal ps/2 plug.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#10 Post by Flash »

CPU0
0: 1430124 XT-PIC timer
1: 2255 XT-PIC keyboard
2: 0 XT-PIC cascade
8: 0 XT-PIC rtc
9: 0 XT-PIC acpi
10: 93210 XT-PIC usb-uhci, usb-uhci
11: 76592 XT-PIC ehci_hcd, usb-uhci, usb-uhci, eth1, VIA8237
14: 6544 XT-PIC ide0
NMI: 0
ERR: 0
PS/2 keyboard, USB trackball mouse

User avatar
slapshot
Posts: 270
Joined: Sun 02 Apr 2006, 13:21
Location: Italy

#11 Post by slapshot »

This is mine. I'm using scroll ps/2 mouse and Puppy 1.08r1 on hd.

Code: Select all

          CPU0       
  0:     365818          XT-PIC  timer
  1:          8          XT-PIC  keyboard
  2:          0          XT-PIC  cascade
  3:     257183          XT-PIC  eth0
  8:          0          XT-PIC  rtc
 10:          0          XT-PIC  usb-uhci, Intel 82801BA-ICH2
 11:          0          XT-PIC  usb-uhci
 12:        596          XT-PIC  PS/2 Mouse
 14:      15278          XT-PIC  ide0
 15:         61          XT-PIC  ide1
NMI:          0 
ERR:          0
Bye.
Slapshot

bugman

#12 Post by bugman »

12: 97512 XT-PIC PS/2 Mouse



No opinion on q2...

User avatar
Fossil
Posts: 1157
Joined: Tue 13 Dec 2005, 21:36
Location: Gloucestershire, UK.

#13 Post by Fossil »

Puppy 108
Pentium 333 mhz
Standard PS/2 Keyboard
Two usb ports, one with attached 2-button scroll-wheel USB Mouse, the other a USB hub.

CPU0
0: 274916 XT-PIC timer
1: 522 XT-PIC keyboard
2: 0 XT-PIC cascade
8: 0 XT-PIC rtc
10: 54058 XT-PIC usb-uhci
11: 1631 XT-PIC eth0
12: 80530 XT-PIC YMFPCI
14: 9252 XT-PIC ide0
15: 93 XT-PIC ide1
NMI: 0
ERR: 0

# cat /proc/bus/usb/devices | grep i -usb
242:S: SerialNumber=e000
303:I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
481:D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
619:I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbmouse
968:I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
1146:D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
1271:S: Product=Flash Disk
1300:S: SerialNumber=1F3F1542522A887D
1373:I: If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=(none)
#


**********

Athlon 1700
Standard PS/2 Keyboard
2-button scroll-wheel USB mouse

CPU0
0: 41648 XT-PIC timer
1: 138 XT-PIC keyboard
2: 0 XT-PIC cascade
5: 5597 XT-PIC usb-uhci, usb-uhci
8: 0 XT-PIC rtc
10: 21 XT-PIC eth0
14: 1386 XT-PIC ide0
15: 678 XT-PIC ide1
NMI: 0
ERR: 0


# cat /proc/bus/usb/devices | grep i -usb
242:S: SerialNumber=dc00
303:I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
481:D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
606:S: Product=Flash Disk
635:S: SerialNumber=1F3F1542522A887D
708:I: If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
1156:S: SerialNumber=d800
1217:I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
1395:D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
1533:I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbmouse


**********

Old Pentium 233 (6x86MX-PR233)
163 Mb RAM
Old large rounded connector (Not PS/2) Keyboard.
2-button scroll-wheel USB mouse.

CPU0
0: 23179 XT-PIC timer
1: 14 XT-PIC keyboard
2: 0 XT-PIC cascade
8: 0 XT-PIC rtc
10: 4246 XT-PIC usb-uhci
14: 975 XT-PIC ide0
15: 1071 XT-PIC ide1
NMI: 0
ERR: 0

# cat /proc/bus/usb/devices | grep i -usb
242:S: SerialNumber=e400
303:I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
481:D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
606:S: Product=Flash Disk
635:S: SerialNumber=1F3F1542522A887D
708:I: If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
980:D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
1118:I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbmouse
#

**********

Compaq Evo N600c laptop.
USB 2-button scroll-wheel mouse (which deactivates the touchpad).

CPU0
0: 97447 XT-PIC timer
1: 97 XT-PIC keyboard
2: 0 XT-PIC cascade
8: 0 XT-PIC rtc
11: 4374 XT-PIC usb-uhci, usb-uhci, usb-uhci, Texas Instruments PCI1420, Texas Instruments PCI1420 (#2), Allegro
14: 681 XT-PIC ide0
15: 611 XT-PIC ide1
NMI: 0
ERR: 0


# cat /proc/bus/usb/devices | grep i -usb
242:S: SerialNumber=4040
303:I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
657:S: SerialNumber=4020
718:I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
896:D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
1021:S: Product=Flash Disk
1050:S: SerialNumber=1F3F1542522A887D
1123:I: If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
1571:S: SerialNumber=4000
1632:I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
1810:D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
1948:I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbmouse
#

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#14 Post by BarryK »

Excellent, we have consistency!

Full mouse autodetection coming soon!

Brian C
Posts: 168
Joined: Thu 09 Feb 2006, 04:19

#15 Post by Brian C »

Question 2: I would like to see both supported simultaneously. When I'm working on my laptop, I'll often use my USB mouse, but will temporarily change to the trackpad (ID-ed as PS/2) when I hunch over the screen. Or when my (wireless) USB mouse's batteries die.

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#16 Post by rarsa »

On the laptop using the trackpad (PS/2)

Code: Select all

 12:       5152          XT-PIC  PS/2 Mouse
On a desktop using PS/2

Code: Select all

 12:       8261          XT-PIC  PS/2 Mouse
I rebooted the laptop with a USB mouse connected but without deleting the "/etc/mousedevice".

The interrupt 12 was still used by the PS/2

After that I did the following
I exited X
deleted /etc/mousedevice
started X again,
selected USB mouse

The interrupt was not being used anymore.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

billstclair
Posts: 106
Joined: Mon 27 Feb 2006, 01:23
Location: Upstate New York
Contact:

#17 Post by billstclair »

With no external mouse, just the laptop trackpad:

Code: Select all

# cat /proc/interrupts
           CPU0       
  0:      56359          XT-PIC  timer
  1:        230          XT-PIC  keyboard
  2:          0          XT-PIC  cascade
  7:       2293          XT-PIC  Intel 82801DB-ICH4, ipw2200
  8:          0          XT-PIC  rtc
  9:          1          XT-PIC  acpi
 11:      71900          XT-PIC  ehci_hcd, usb-uhci, usb-uhci, usb-uhci, PCI device 1217:7113 (O2 Micro, Inc.), PCI device 1217:7113 (O2 Micro, Inc.)
 12:       3294          XT-PIC  PS/2 Mouse
 14:          9          XT-PIC  ide0
 15:         39          XT-PIC  ide1
NMI:          0 
ERR:          0
With an external USB mouse plugged in (and a reboot):

Code: Select all

# cat /proc/interrupts
           CPU0       
  0:      47015          XT-PIC  timer
  1:        110          XT-PIC  keyboard
  2:          0          XT-PIC  cascade
  7:        175          XT-PIC  Intel 82801DB-ICH4, ipw2200
  8:          0          XT-PIC  rtc
  9:          1          XT-PIC  acpi
 11:      71630          XT-PIC  ehci_hcd, usb-uhci, usb-uhci, usb-uhci, PCI device 1217:7113 (O2 Micro, Inc.), PCI device 1217:7113 (O2 Micro, Inc.)
 12:        567          XT-PIC  PS/2 Mouse
 14:          9          XT-PIC  ide0
 15:         39          XT-PIC  ide1
NMI:          0 
ERR:          0

muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

#18 Post by muggins »

1: 2937 XT-PIC keyboard

12: 36016 XT-PIC PS/2 Mouse

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#19 Post by jcoder24 »

Apr 6 news wrote:You still have to choose keyboard country-layout and whether your mouse has a scrollwheel.
What would happen if I had a mouse without a scroll button and told puppy that I did? If it doesn't (adversely) affect puppy, then we can just assume that all mice are scroll mice and that would allow us to get rid of one other dialog.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#20 Post by BarryK »

jcoder24,
That's a very interesting question. I have previously done that, as I'm often changing mice, and did not notice any ill effects...
maybe though, we need some volunteers to try this with various non-scrollwheel mouses, to confirm no ill effects.
...I've only got 2-button mouses, need to check with 3-button non-scrollwheel, plus serial, usb, ps/2 types, different brands, and weird ones like that MS multi-everything mouse.

Post Reply