1

When I ever boot into Ubuntu my wireless usb mouse gets stuck for moments frequently and the mouse wheel is too sensitive. Only when I unplug the wireless usb and plug it back in does the mouse return to normal.

I would like to simulate unplugging and plugging in my usb mouse in my startup bash script so that I don't have to do it manually every time. Is there a terminal command for this?

Thanks so much.

terminal:~$ xinput -list
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Microsoft Microsoft® Nano Transceiver v2.0    id=10   [slave  pointer  (2)]
⎜   ↳ Microsoft Microsoft® Nano Transceiver v2.0    id=11   [slave  pointer  (2)]
⎜   ↳ eGalax Inc. eGalaxTouch EXC3000-0367-44.00.00 id=13   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=15   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Microsoft Microsoft® Nano Transceiver v2.0    id=9    [slave  keyboard (3)]
    ↳ HP Webcam                                 id=12   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=14   [slave  keyboard (3)]
    ↳ HP Wireless hotkeys                       id=16   [slave  keyboard (3)]
    ↳ HP WMI hotkeys                            id=17   [slave  keyboard (3)]
terminal:~$ xinput --list-props
Usage: xinput list-props <device> [<device> ...]
terminal:~$ xinput --list-props 11
Device 'Microsoft Microsoft® Nano Transceiver v2.0':
    Device Enabled (143):   1
    Coordinate Transformation Matrix (145): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    Device Accel Profile (272): 0
    Device Accel Constant Deceleration (273):   1.000000
    Device Accel Adaptive Deceleration (274):   1.000000
    Device Accel Velocity Scaling (275):    10.000000
    Device Product ID (261):    1118, 1861
    Device Node (262):  "/dev/input/event7"
    Evdev Axis Inversion (276): 0, 0
    Evdev Axes Swap (278):  0
    Axis Labels (279):  "Rel X" (153), "Rel Y" (154), "Rel Horiz Wheel" (268)
    Button Labels (280):    "Button 0" (265), "Button Unknown" (264), "Button Unknown" (264), "Button Wheel Up" (149), "Button Wheel Down" (150), "Button Horiz Wheel Left" (151), "Button Horiz Wheel Right" (152)
    Evdev Scrolling Distance (281): 1, 1, 1
    Evdev Middle Button Emulation (282):    0
    Evdev Middle Button Timeout (283):  50
    Evdev Third Button Emulation (284): 0
    Evdev Third Button Emulation Timeout (285): 1000
    Evdev Third Button Emulation Button (286):  3
    Evdev Third Button Emulation Threshold (287):   20
    Evdev Wheel Emulation (288):    0
    Evdev Wheel Emulation Axes (289):   0, 0, 4, 5
    Evdev Wheel Emulation Inertia (290):    10
    Evdev Wheel Emulation Timeout (291):    200
    Evdev Wheel Emulation Button (292): 4
    Evdev Drag Lock Buttons (293):  0
terminal:~$ xinput --list-props 10
Device 'Microsoft Microsoft® Nano Transceiver v2.0':
    Device Enabled (143):   1
    Coordinate Transformation Matrix (145): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    Device Accel Profile (272): 0
    Device Accel Constant Deceleration (273):   1.000000
    Device Accel Adaptive Deceleration (274):   1.000000
    Device Accel Velocity Scaling (275):    10.000000
    Device Product ID (261):    1118, 1861
    Device Node (262):  "/dev/input/event6"
    Evdev Axis Inversion (276): 0, 0
    Evdev Axes Swap (278):  0
    Axis Labels (279):  "Rel X" (153), "Rel Y" (154), "Rel Horiz Wheel" (268), "Rel Dial" (269), "Rel Vert Wheel" (270), "Rel Misc" (271)
    Button Labels (280):    "Button Left" (146), "Button Middle" (147), "Button Right" (148), "Button Wheel Up" (149), "Button Wheel Down" (150), "Button Horiz Wheel Left" (151), "Button Horiz Wheel Right" (152), "Button Side" (266), "Button Extra" (267), "Button Unknown" (264), "Button Unknown" (264), "Button Unknown" (264), "Button Unknown" (264)
    Evdev Scrolling Distance (281): 1, 1, 1
    Evdev Middle Button Emulation (282):    0
    Evdev Middle Button Timeout (283):  50
    Evdev Third Button Emulation (284): 0
    Evdev Third Button Emulation Timeout (285): 1000
    Evdev Third Button Emulation Button (286):  3
    Evdev Third Button Emulation Threshold (287):   20
    Evdev Wheel Emulation (288):    0
    Evdev Wheel Emulation Axes (289):   0, 0, 4, 5
    Evdev Wheel Emulation Inertia (290):    10
    Evdev Wheel Emulation Timeout (291):    200
    Evdev Wheel Emulation Button (292): 4
    Evdev Drag Lock Buttons (293):  0

Edit: it seems as though from above that ubuntu is running two drivers for the same mouse under id 10 and 11.

Edit: I solved the mouse bug.

In the file..

/etc/laptop-mode/conf.d/runtime-pm.conf

I had to make

CONTROL_RUNTIME_AUTOSUSPEND=0

This fixes the mouse bug I was experiencing for years.

1
  • You can try loading and unloading the driver. That has Pretty much same effect. I'm on mobile though so can't say much more on that right now Mar 30, 2016 at 2:27

1 Answer 1

0

Try something like this:

sudo modprobe -r usbhid && sudo modprobe usbhid

You can put that in a script and link the script to a keyboard shortcut, or something along those lines (you'd have to do something about the sudo perms there if you wanted a shortcut).

If this doesn't work, try adding a sleep in there like this:

sudo modprobe -r usbhid && sleep 2 && sudo modprobe usbhid
4
  • Is there a script that runs with root privileges at startup so I can use these commands? I want to avoid any repetitive manual labour.
    – deanresin
    Mar 30, 2016 at 3:02
  • Heh, yea, put these lines in /etc/rc.local BEFORE the exit 0 line. That is run every startup...I think (maybe every login). You might need a sleep before them too if you are running it at startup. Something like sleep 5 && sudo modprobe -r ... EDIT: Now that I think about this, I'll just give you one line to stick in there. Put this before the exit 0 line: ( sleep 2 && modprobe -r usbhid && sleep 2 && modprobe usbhid ) & Mar 30, 2016 at 3:36
  • [sudo modprobe -r usbhid ... sudo modprobe usbhid] run in the terminal has no effect :( I still have to unplug and plug in the usb mouse. I think it has something to do with duplicate entries in xinput -list.
    – deanresin
    Mar 30, 2016 at 5:14
  • Hmm, then this is a bust. Sorry, but I'm not sure what else to do. Mar 31, 2016 at 6:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .