I just had a problem with my mouse - and it turned out it was a hardware one (it is one of those Logitech Wireless USB mice, which have a 'smooth scroll' option on the middle button wheel - you press it once, you have 'smooth scroll', press it once more, then you have 'stepped' scroll...) Turns out, my middle wheel was stuck, so I had to press it a couple of times until it 'recovered' - and I used xev
(on Ubuntu 10.04) to control this.
To say a couple more words on the mouse under Ubuntu - you can inspect the system log, to see what was logged upon boot, in respect to, say, USB devices - to see if the device is recognized at all. However, this with the "system log" is not necessarily fixed - on Ubuntu 10.04, I simply look in /var/log/messages
- but in 11.04, the 'Logitech' string shows in these files:
$ grep --files-with-matches --recursive Logitech /var/log 2>/dev/null
/var/log/spnavd.log
/var/log/Xorg.0.log
/var/log/Xorg.1.log
/var/log/dmesg.0
/var/log/Xorg.0.log.old
/var/log/dmesg
/var/log/kern.log.1
/var/log/udev
Under 11.04, I guess one way is to grep/search for 'usb' string in /var/log/dmesg
- or maybe even easier; again for 'Logitech' string:
$ grep Logitech /var/log/dmesg
[ 22.323032] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/input/input7
[ 22.323529] generic-usb 0003:046D:C526.0001: input,hidraw0: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:00:1d.1-1/input0
[ 22.502664] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.1/input/input8
[ 22.509847] generic-usb 0003:046D:C526.0002: input,hiddev0,hidraw1: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:1d.1-1/input1
What you want, is to see which "USB address" the device is connected to - above we see "usb3
", so we can basically "cat
" to stdout the corresponding usbmon
file under /dev
(that is, /dev/usbmon3
); this should give us the "raw" USB data coming in from the device; since this binary cannot be directly rendered in terminal, we'd pipe it into hexdump
to have it formatted:
$ sudo cat /dev/usbmon3 | hexdump -C
00000000 80 6b 14 f1 00 00 00 00 43 01 81 02 03 00 2d 00 |.k......C.....-.|
00000010 4c e0 75 4e 00 00 00 00 41 5a 07 00 00 00 00 00 |L.uN....AZ......|
00000020 08 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 ff ff 00 00 00 00 80 6b 14 f1 00 00 00 00 |.........k......|
00000040 53 01 81 02 03 00 2d 3c 4c e0 75 4e 00 00 00 00 |S.....-<L.uN....|
....
Now, when you perform actions on the mouse (move, button press), more data should respectively be shown in terminal (kill this process eventually with Ctrl-C). Note you'd have to use sudo
in the command above.
The point is - if in the test above, you get data generated when you move the mouse scroll-wheel up and down; then at least the hardware and the USB driver portion of the chain should be working - if all is working, then those events should propagate to the X system, and be reported by xev
as well. (since in my case I didn't see these events, I could then deduce a hardware problem; which, this time, was luckily easily solved with a just couple of presses. Also note - when all works, moving the scroll wheel also generates data in terminal, so you won't be able to scroll the terminal with the scroll wheel :) in that case, revert back temporarily to keyboard arrows scrolling of terminal).
Thanks! Works like a charm. Are there any such available for Windows? Note: I have marked this as an accepted answer because my question was OS - agnostic. – Kanini – 2010-11-06T03:26:37.870
Not a clue. I suppose a program could hook the mouse messages and display them as caught, but I don't know of such a program. – Ignacio Vazquez-Abrams – 2010-11-06T03:36:27.537