Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

command to refresh usb mouse..

  • 08-02-2011 9:53pm
    #1
    Registered Users, Registered Users 2 Posts: 2,236 ✭✭✭


    Hi Guys,

    Just installed Ubuntu and loving it so far.

    I'm having a problem with my mouse though! It scrolls through documents/web pages really fast.. I need to unplug the mouse then plug it back in to get it to slow down.

    Just wondering is there a command/script that would refresh or disable/enable the usb devices in the computer. I could then put this in the "startup folder"..?

    Cheers!


Comments

  • Closed Accounts Posts: 4,564 ✭✭✭Naikon


    techguy wrote: »
    Hi Guys,

    Just installed Ubuntu and loving it so far.

    I'm having a problem with my mouse though! It scrolls through documents/web pages really fast.. I need to unplug the mouse then plug it back in to get it to slow down.

    Just wondering is there a command/script that would refresh or disable/enable the usb devices in the computer. I could then put this in the "startup folder"..?

    Cheers!

    You can use xinput to disable/enable the mouse on the fly.
    As root: "apt-get install xinput"
    Scan for your mouse: "xinput list | grep -i mouse"
    

    Now you will see a list of devices matching the "mouse" string.
    You can now disable the mouse with the matching string.

    For example, on my machine the list returns:
    ⎜   ↳ ImPS/2 Logitech Wheel Mouse             	id=9	[slave  pointer  (2)]
    ⎜   ↳ Macintosh mouse button emulation        	id=10	[slave  pointer  (2)]
    

    Now, you can disable the mouse by subsituting the 1st device string above with the following:
    ENABLE:
    xinput set-int-prop "ImPS/2 Logitech Wheel Mouse" "Device Enabled" 8 1
    
    DISABLE:
    xinput set-int-prop "ImPS/2 Logitech Wheel Mouse" "Device Enabled" 8 0
    

    Forget the desktop icon, add these two aliases to your .bashrc file:
    alias mouse_enable='xinput set-int-prop "ImPS/2 Logitech Wheel Mouse" "Device Enabled" 8 1'
    alias mouse_disable='xinput set-int-prop "ImPS/2 Logitech Wheel Mouse" "Device Enabled" 8 0'
    

    Now from your shell, just type mouse_enable or mouse_disable to enable/disable as required. You could use the following script to do the job, or even set the mouse on and
    off using cron/anacron entries. shopt is required for non interactive shell sessions, so you need that line to expand your newly defined aliases, otherwise it won't work.
    #!/bin/sh
    shopt -s expand_aliases
    source /home/<your_name_here>/.bashrc
    mouse_disable
    mouse_enable
    


  • Registered Users, Registered Users 2 Posts: 2,236 ✭✭✭techguy


    Thanks so much, Naikon!

    The problem seems to have sorted itself out now. No need to unplug mouse anymore!

    Cheers! :)


  • Closed Accounts Posts: 4,564 ✭✭✭Naikon


    techguy wrote: »
    Thanks so much, Naikon!

    The problem seems to have sorted itself out now. No need to unplug mouse anymore!

    Cheers! :)

    Glad to be of some service :D

    Welcome to the land of Unix/Linux btw. I think you will be around for a long time. It's nice to actually see somebody treating the OS on it's own merits and not expecting an open source version of Windows. Ubuntu will serve you well.


Advertisement