Page 1 of 4 123 ... LastLast
Results 1 to 10 of 35

Thread: Hardy and mice with thumb / scroll buttons

  1. #1
    Join Date
    Apr 2005
    Location
    Devonshire
    Beans
    60
    Distro
    Ubuntu 12.04 Precise Pangolin

    How to configure mice with thumb / scroll buttons in Hardy

    This tutorial explains how to get the thumb buttons to work with Hardy (sometimes the thumb buttons will work with Firefox but not with Nautilus, on other installations the thumb buttons do nothing).

    The widely-circulated instructions that install imwheel, then create an 63xmodmap file, etc, no longer work with Hardy (whether you do a fresh install or an upgrade from Gutsy).

    The tutorial has been tested using several mice, including Intellimouse and Logitech Nano VX.

    I've divided the tutorial into several steps, some of which you might be able to skip.




    Step 1 - Undoing previous changes

    If you've followed imwheel/xmodmap/startup.conf instructions described in other threads then this step describes how to clean/remove all the stuff you've done.

    If you've never installed imwheel then you can skip this step.


    Re-configure xorg.conf

    Make a copy of xorg.conf, just in case things go wrong
    Code:
    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.original
    Note: If things do go wrong and you can no longer start X, then this
    Code:
    sudo cp /etc/X11/xorg.conf.original /etc/X11/xorg.conf
    will recover your original xorg.conf file. Case matters. Make a note of it before you continue!


    Now, edit xorg.conf with
    Code:
    gksu gedit /etc/X11/xorg.conf
    The mouse section probably looks similar to this:
    Code:
    Section "InputDevice" 
         Identifier    "Configured Mouse"  
         Driver        "mouse" 
         Option        "CorePointer" 
         Option        "Device"    "/dev/input/mice" 
         Option        "Protocol"    "ExplorerPS/2" 
         Option        "Buttons"    "7" 
         Option        "ButtonMapping"    "1 2 3 8 9"  
         Option        "Emulate3Buttons"    "false" 
    EndSection
    Change it to this:
    Code:
    Section "InputDevice"
        Identifier    "Configured Mouse"
        Driver        "mouse"
        Option        "CorePointer"
    EndSection
    Save, then Quit.


    Re-configure the imwheel startup file

    You no longer need imwheel to start as the machine boots, so
    Code:
    gksu gedit /etc/X11/imwheel/startup.conf
    and change the setting (back) to
    Code:
    IMWHEEL_START=0

    Delete the xmodmap file

    Various threads create either 57xmodmap or 63xmodmap. Whatever, you won't need them anymore.
    Code:
    sudo rm /etc/X11/Xsession.d/57xmodmap*
    or
    Code:
    sudo rm /etc/X11/Xsession.d/63xmodmap*
    (I've added the * because if you've edited more than once there will be 63xmodmap and 63xmodmap~).

    OK, other than the .imwheelrc file (which you'll edit below) you should now be back where you started.


    Check that imwheel no longer starts

    Restart your computer, then click System > Administration > System monitor > Processes and search for an imwheel entry - there shouldn't be one!




    Step 2 - Just upgraded from Gutsy?

    If you've upgraded from Gutsy the mouse section of the xorg.conf file isn't the same as if you'd done a fresh install of Hardy. This step makes them the same.

    Skip this section if you've done a fresh install of Hardy (or just completed Step 1).

    Make a copy of xorg.conf, just in case things go wrong
    Code:
    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.original
    Note: If things do go wrong and you can no longer start X, then this
    Code:
    sudo cp /etc/X11/xorg.conf.original /etc/X11/xorg.conf
    will recover your original xorg.conf file. Case matters. Make a note of it before you continue!


    Now, edit xorg.conf with
    Code:
    gksu gedit /etc/X11/xorg.conf
    The mouse section probably looks similar to this:
    Code:
    Section "InputDevice" 
         Identifier    "Configured Mouse"  
         Driver        "mouse" 
         Option        "CorePointer" 
         Option        "Device"    "/dev/input/mice" 
         Option        "Protocol"    "ExplorerPS/2" 
    EndSection
    Change it to this:
    Code:
    Section "InputDevice"
        Identifier    "Configured Mouse"
        Driver        "mouse"
        Option        "CorePointer"
    EndSection
    Save, Quit, then Restart your computer.




    Step 3 - Which imwheel is right for you?

    You should not skip this step.

    In Gutsy it doesn't seem to matter, but in Hardy it does; imwheel can run in 2 modes, controlled by the -f (for focus) parameter. Use the wrong mode and you'll either run out of memory after 20 minutes, or your computer will fail to come out of screensaver/hibernation.

    According to the imwheel documentation, the -f parameter "Forces the X event subwindow to be used instead of the original hack that would replace the subwindow in the X event with a probed focus query (XGetInputFocus)", which clears that up then!


    Install imwheel

    If you haven't previously done so, install imwheel with
    Code:
    sudo apt-get install imwheel

    Make imwheel autostart when you log on

    Create an autostart folder with
    Code:
    mkdir ~/.config/autostart
    (don't worry if it already exists).

    Then create a new autostart file with
    Code:
    gedit ~/.config/autostart/amouse.desktop
    Copy and paste this
    Code:
    [Desktop Entry]
    Type=Application
    Encoding=UTF-8
    Version=1.0
    Name=amouse
    Comment=amouse
    Exec=imwheel
    X-GNOME-Autostart-enabled=true
    Save, then Quit.


    Find which imwheel mode to use

    Restart your computer (logout/login is not enough), then click System > Administration > System monitor > Processes and scroll down to the imwheel entry.

    If imwheel is Running, using 15-20% of processor time and eating memory then you need the -f parameter.

    If imwheel is Sleeping, using 0% processor time, and using 200-300k memory, then you do not need the -f parameter.

    Click on the imwheel process, then click End Process (and again!).




    Step 4 - Quick and easy thumb buttons

    If you're just looking for a quick and easy way to get the thumb buttons to work, if you don't want to mess with the scroll buttons, or swap buttons around then this step's for you. Thanks to Cubeist.

    Do not do this step until you've done Step 3.


    Create and configure .imwheelrc


    Create an .imwheelrc file with
    Code:
    gedit ~/.imwheelrc
    Copy and paste this
    Code:
    ".*"
    None, Up, Alt_L|Left
    None, Down, Alt_L|Right
    
    "(null)"
    None, Up, Alt_L|Left
    None, Down, Alt_L|Right

    Make imwheel start when you turn your computer on

    Edit the autostart file you created in step 3 with
    Code:
    gedit ~/.config/autostart/amouse.desktop
    If you need the -f parameter, change the Exec line to:
    Code:
    Exec=imwheel -k -f -b "0 0 0 0 8 9"
    If you do not need the -f parameter, change the Exec line to:
    Code:
    Exec=imwheel -k -b "0 0 0 0 8 9"
    Save then Quit, and that's it.

    Logout/login and the two thumb buttons should work.

    Note: if they're the wrong way round then re-edit .imwheelrc and swap Up and Down. Save, Quit then logout/login again.




    Step 5 - Troubleshooting your buttons

    (...or, a bit more about imwheel and xmodmap)

    This step provides a technique to help you work out what button does what. The aim is not to make the buttons do anything useful, just to identify a 'best mapping' between imwheel and xmodmap. You can play with the settings until you get it right!

    imwheel can take control of button 'events' 4,5,6,7,8,9,10 and 11.

    imwheel reckons that:
    • Buttons 4,5 represent the forward/backward scroll wheel, and calls them Up, Down
    • Buttons 6,7 represent the left/right tilt wheel, and calls them Left, Right
    • Buttons 8,9 represent the 2 thumb buttons, and calls them Thumb1, Thumb2
    • Buttons 10,11 represent any extra buttons, and calls them ExtBt7, ExtBt8


    imwheel is unable to do anything to button 'events' 1, 2 or 3 (left, middle and right click).

    In an ideal world imwheel numbers and your mouse button 'event' numbers would match... but with some mice they don't. Which is where xmodmap comes in - it enables you to renumber/remap the buttons.


    Configure an experimental .imwheelrc

    Edit your .imwheelrc file with
    Code:
    gedit ~/.imwheelrc
    Copy and paste this for initial testing
    Code:
    ".*"
    None, Up, U
    None, Down, D
    None, Left, L
    None, Right, R
    None, Thumb1, 1
    None, Thumb2, 2
    None, ExtBt7, 7
    None, ExtBt8, 8
    When you click various buttons in a text editor (below) the mouse will type U,D,L,R,1,2,7,8

    Once you know which button does what you can re-edit .imwheelrc to do something more useful.

    The None at the beginning of each line means 'just the mouse button' (ie. without a modifier)... See man imwheel for more, but you can set up the Thumb button, Alt+Thumb, Ctrl+Thumb, etc.

    In many guides the codes are repeated under the entry "(null)". I've not (yet) found any instance where this is needed.


    Testing your buttons

    Essentially, we're trying to identify which button on the mouse corresponds to Up, Down, Left, Right, Thumb1, Thumb2, ExtBt7, ExtBt8 (though you may not have them all).

    Start the Text editor (in Accessories)

    In Terminal:

    If you need the -f parameter, copy and paste this:
    Code:
    xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9"; imwheel -k -f -b "4 5 6 7 8 9"
    If you do not need the -f parameter, copy and paste this:
    Code:
    xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9"; imwheel -k -b "4 5 6 7 8 9"
    • The ; lets you do multiple commands in one go.
    • The xmodmap command sets up a pointer array with 9 buttons. Notice that I've added all 9 - adding less creates an warning/error, as does repeating the same number twice.
    • The imwheel command means that when button4 is pressed the matching action in .imwheelrc happens, etc. The -k stops any running instances of imwheel.

    Click into the Text editor and click away. On my mouse both thumbs but only one of the scroll buttons work with the above settings.

    Press the up-arrow in Terminal to re-edit the command.

    The variant below works best for me (in the xmodmap command I've swapped the 4-5 and the 6-7 pairs). It gives me control over forward-scroll, backward-scroll, small-thumb and big-thumb.
    Code:
    xmodmap -e "pointer = 1 2 3 6 7 4 5 8 9"; imwheel -k -f -b "4 5 6 7 8 9"
    If you don't want to muck about with the scroll wheels, and just want to grab the thumb-buttons then try the following variant (the 0 means imwheel does not take control of button events 4,5,6, and 7, so only 'events' 8 and 9 are processed).
    Code:
    xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9"; imwheel -k -f -b "0 0 0 0 8 9"
    Changing 8 9 to 9 8 will swap the thumbs
    Code:
    xmodmap -e "pointer = 1 2 3 4 5 6 7 9 8"; imwheel -k -f -b "0 0 0 0 8 9"
    You could do this in either the xmodmap or the imwheel command, but not both or you're back where you started!

    If you're left handed and only want to swap the left and right buttons try this
    Code:
    xmodmap -e "pointer = 3 2 1 4 5 6 7 8 9"; imwheel -k -f -b "0 0 0 0 8 9"
    Assuming this works for you make a note of the modmap and imwheel numbers because they're needed in the step 7.




    Step 6 - What do you want your buttons to do?

    Making your mouse buttons type U,D,L,R, etc isn't all that handy.

    The .imwheelrc file enables you to make the thumb buttons (usually) do something special. For instance they might be set to mean 'copy' and 'paste' in the OpenOffice Wordprocessor, and Next/Prev in Firefox/Nautilus. A couple of examples:
    • If your mouse responds by typing L and R when you click the thumb buttons, replace L and R with Alt_L|Left and Alt_L|Right ...this lets you scroll to next/previous in Firefox, Nautilus, etc
    • If your mouse responds by typing 1 and 2 when you click the thumb buttons, replace the 1 and 2 with Control_L|c and Control_L|v ...the thumb buttons will work as copy and paste
    • Fed up double-clicking? Replace the thumb button action with [COLOR=Indigo]Button1, 2[/Indigo] and a single click of the thumb button will be a double-click (note the , 2 which means do Button1 twice)

    Alt_L means the left Alt key, Control_L means the left Control key (so you can guess what _R does!)


    Configure .imwheelrc

    Edit the .imwheelrc file with
    Code:
    gedit ~/.imwheelrc
    Replace the test letters with a more appropriate action.

    To test the changes you make to .imwheelrc ...save, then re-run your preferred variant of the xmodmap -e "pointer = 1 2 3 6 7 4 5 8 9"; imwheel -k -f -b "4 5 6 7 8 9" command in Terminal.




    Step 7 - Configuring your mouse with imwheel and xmodmap

    Assuming that you've now got .imwheelrc as you want it (Step 6), we need to make imwheel/xmodmap start when you login.


    Create a .Xmodmap file
    Code:
    gedit ~/.Xmodmap
    Copy and paste this
    Code:
    pointer = 1 2 3 4 5 6 7 8 9
    Replace the pointer numbers so they match what you wrote down in Step 5. Notice that you don't need the xmodmap -e bit. Save, then Quit.


    Make imwheel start when you turn your computer on

    Edit the autostart file you created in step 3 with
    Code:
    gedit ~/.config/autostart/amouse.desktop
    If you need the -f parameter, change the Exec line to:
    Code:
    Exec=imwheel -k -f -b "0 0 0 0 8 9"
    If you do not need the -f parameter, change the Exec line to:
    Code:
    Exec=imwheel -k -b "0 0 0 0 8 9"
    Replace the imwheel numbers so they match what you wrote down in Step 5.

    Save, then Quit, and that's it.

    Logout/login and you'll be asked what to do with the .Xmodmap file you created. Click on it then Add (so it appears on the left), then ok. Your new mouse setting should work.




    Further information
    You can do the same thing as the .config/autostart stuff by clicking System > Preferences > Sessions > Add)

    According to http://bugzilla.gnome.org/show_bug.cgi?id=314800 we can expect a fix sometime soon, but as the bug was first reported in Aug 2005 don't hold your breath.

    Some threads covering ATI graphics drivers suggest that xserver-xgl needs to be installed. This caused my working imwheel setup to fail! On Hardy, uninstalling xserver-xgl didn't affect my graphics and imwheel worked once more.
    Last edited by pannerrammer; May 24th, 2008 at 07:25 PM. Reason: new method of handling xmodmap, new flag in imwheel

  2. #2
    Join Date
    Dec 2006
    Beans
    Hidden!
    Distro
    Ubuntu Mate

    Re: Hardy and mice with thumb / scroll buttons

    I have an Intellimouse Explorer USB/PS2 mouse that's hooked up via PS2 connection.

    I had all the buttons working in Gutsy just by setting the following in /etc/X11/xorg.conf:
    Code:
    Section "InputDevice"
        Identifier     "Configured Mouse"
        Driver         "mouse"
        Option         "CorePointer"
        Option         "Device" "/dev/input/mice"
        Option         "Protocol" "ExplorerPS/2"
        Option         "Buttons"       "7"
        Option         "ButtonMapping" "1 2 3 6 7"
        Option         "ZAxisMapping"  "4 5"
        Option         "Emulate3Buttons" "true"
    EndSection
    I never installed imwheel before.

    After I upgraded to Hardy, the entries above are still in xorg.conf, but I no longer have the thumb buttons working in Firefox or Nautilus. (They never did work in Nautilus, but they worked in Firefox.)

    I followed Method 1 of the instructions and except for having to create the folder/file autostart/amouse.desktop first before Gedit would let me save to it, it all went smoothly.

    I restarted and confirmed in System->Administration->System Monitor->Processes that imwheel is there, and it says it's "sleeping", but I still don't have working thumb buttons in Firefox.

    Is there something else I need to do or some way I can troubleshoot this?

  3. #3
    Join Date
    Apr 2005
    Location
    Devonshire
    Beans
    60
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Hardy and mice with thumb / scroll buttons

    Hi linux4me.

    First, edit your /etc/X11/xorg.conf so it looks like this
    Code:
    Section "InputDevice"
        Identifier     "Configured Mouse"
        Driver         "mouse"
        Option         "CorePointer"
    #    Option         "Device" "/dev/input/mice"
    #    Option         "Protocol" "ExplorerPS/2"
    #    Option         "Buttons"       "7"
    #    Option         "ButtonMapping" "1 2 3 6 7"
    #    Option         "ZAxisMapping"  "4 5"
    #    Option         "Emulate3Buttons" "true"
    EndSection
    The # simply makes the line a comment. Then reboot the pc so the new config is active. The lines you've commented out don't appear at all when you do a new install of Hardy.

    You might have created the amouse.desktop file in the wrong place because the .config/autostart folder should already exist (because it's where your Sessions stuff (like Evolution notification) is. Check amouse.desktop is listed in Sessions by clicking System > Preferences > Sessions (if not you can click Add - the command is
    Code:
    imwheel -k -f -b "0 0 0 0 8 9"
    and the rest is amouse).

    Does this help?

  4. #4
    Join Date
    Feb 2007
    Beans
    90

    Re: Hardy and mice with thumb / scroll buttons

    One of the surprising things I found with my fresh install is that my thumb buttons worked 'out of the box' with my Cordless Desktop MX3000 mouse.

  5. #5
    Join Date
    Apr 2005
    Location
    Devonshire
    Beans
    60
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Hardy and mice with thumb / scroll buttons

    Quote Originally Posted by Chokkan View Post
    One of the surprising things I found with my fresh install is that my thumb buttons worked 'out of the box' with my Cordless Desktop MX3000 mouse.
    Hi Chokkan.
    Do your thumb buttons work with Nautilus, or just Firefox?
    Regards, pannerrammer

  6. #6
    Join Date
    Dec 2006
    Beans
    Hidden!
    Distro
    Ubuntu Mate

    Talking Re: Hardy and mice with thumb / scroll buttons

    Quote Originally Posted by pannerrammer View Post
    First, edit your /etc/X11/xorg.conf so it looks like this
    Code:
    Section "InputDevice"
        Identifier     "Configured Mouse"
        Driver         "mouse"
        Option         "CorePointer"
    #    Option         "Device" "/dev/input/mice"
    #    Option         "Protocol" "ExplorerPS/2"
    #    Option         "Buttons"       "7"
    #    Option         "ButtonMapping" "1 2 3 6 7"
    #    Option         "ZAxisMapping"  "4 5"
    #    Option         "Emulate3Buttons" "true"
    EndSection
    The # simply makes the line a comment. Then reboot the pc so the new config is active. The lines you've commented out don't appear at all when you do a new install of Hardy.
    Hooray! Commenting out those lines worked perfectly! Thanks pannerrammer!

    I can't explain the issue with the folder autorun and saving the amouse file. I can confirm that it does appear in sessions, and I do use Evolution, but there wasn't an autostart folder in /home/<my account name>/.config. Very strange.

  7. #7
    Join Date
    Jun 2007
    Beans
    157
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Hardy and mice with thumb / scroll buttons

    I got my MS Intellimouse working correctly with the following configuration in .imwheelrc:

    Code:
    ".*"
    #None, Up, Alt_L|Left
    #None, Down, Alt_L|Right
    None, Thumb1, Alt_L|Left
    None, Thumb2, Alt_L|Right
    
    "(null)"
    None, Up, Alt_L|Left
    None, Down, Alt_L|Right
    I commented the Up and Down lines and got:
    - scroll wheel scrolls correctly in Nautilus and Firefox
    - Thumb buttons correctly go back/forward in Nautilus and FF

  8. #8
    Join Date
    Dec 2006
    Beans
    Hidden!
    Distro
    Ubuntu Mate

    Re: Hardy and mice with thumb / scroll buttons

    I should mention I decided to switch from 32-bit Hardy to 64-bit, and did a clean install of 64-bit Hardy.

    My Intellimouse Explorer (PS2), including the wheel and thumb buttons, worked without any tweaking on my part at all, and imwheel was not required.

    I don't know if it was the clean install or a difference with 64-bit, but I am happy.

  9. #9
    Join Date
    Sep 2007
    Beans
    51

    Re: Hardy and mice with thumb / scroll buttons

    I have a microsoft intellimouse 1.1a and it works out of the box in hardy (in "explorer" and firefox (in feisty I needed to edit the xorg.conf), althought in opera it doesn't work...it is needed to instal imwheel?
    any tips?
    I am using hardy 64bit.
    PowerMac G4 400MHZ Gigabit Ethernet/1.75Gb PC133/Geforce 6200 256MB/PCI WIFI RT3060/USB 2.0 NEC/Viewsonic PF775

  10. #10
    Join Date
    Apr 2005
    Location
    Devonshire
    Beans
    60
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Hardy and mice with thumb / scroll buttons

    Quote Originally Posted by skinnie View Post
    I have a microsoft intellimouse 1.1a and it works out of the box in hardy (in "explorer" and firefox (in feisty I needed to edit the xorg.conf), althought in opera it doesn't work...it is needed to instal imwheel?
    any tips?
    I am using hardy 64bit.
    Hi skinnie.

    When Hardy was released Firefox recognised the thumb buttons because of coding in Firefox (not because of the coding in Hardy). Similar coding is promised for the back/forward buttons in Nautilus - I presume you mean Nautilus, not "explorer"

    But I don't think that will extend to OpenOffice or Opera, etc.

    I did a fresh install of hardy 64bit today and uploaded all the updates, but the thumb buttons still don't work (for me) in Nautilus without imwheel. So, to get Opera to respond to the thumb buttons I'd guess you need imwheel too.

    pannerrammer

Page 1 of 4 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •