Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: HOWTO: Emulate3Buttons = false in Lucid with udev

  1. #1
    Join Date
    Aug 2006
    Location
    Australia
    Beans
    1,438

    Talking HOWTO: Emulate3Buttons = false in Lucid with udev

    Who this is for:
    People running Ubuntu 10.04+ who want their mouse to register a left + right click to be 2 events (left mouse and right mouse), rather than the default of emulating a middle click.
    - This is very important if you play many games, or if you simply have a middle button on your mouse and don't like the default Ubuntu behavior.

    This has been tested successfully with Ubuntu 10.04 alpha 3 64bit, and should work fine after Ubuntu 10.04's formal release and both platforms (32 and 64bit).


    A brief back story:
    The new xorg in 10.04 does not depend on /etc/X11/xorg.conf or even HAL for that matter now.
    So a new system of using udev gets this working quite easily and effectively.


    Ok, let's do it!:
    To get it working properly, Open up a terminal, in Applications --> Accessories --> Terminal and run the following command:
    Code:
    gksu gedit /etc/udev/rules.d/mouse-gaming.rules
    Enter in your password when prompted, then copy and paste this into gedit:
    Code:
    ENV{x11_options.Emulate3Buttons}="False"
    Save the file in gedit, then exit gedit.
    Now all you need to do is to unplug your mouse, then plug it back in again. The settings will have come into effect and your mouse will be good to use again for lots gaming in Lucid
    If you're too lazy to unplug and replug your mouse in, you may alternatively run the following from a terminal:
    Code:
    sudo service udev restart

    To reverse this back to the way it was:
    Open up a terminal, in Applications --> Accessories --> Terminal and run the following command:
    Code:
    sudo rm /etc/udev/rules.d/mouse-gaming.rules
    Then enter in your password if / when prompted.


    Credits:
    • I have to give thanks to pi/roman for his great tutorial here which details the process to get a touchpad working on a laptop nicely with udev.
    • Restarting udev is better than disconnecting and reconnecting your mouse, with thanks to tqft for his post here
    • Also this is in effect a continuation from my last thread here about getting it to work the old way with HAL


    Ubuntu 10.10 note:
    An easier way to do this in Ubuntu 10.10 (this may work in Ubuntu 10.04, but is untested by myself):
    For every new mouse that you use on your Ubuntu 10.10 system, press the middle mouse button (which on most mice all you have to do is push down on the scroll wheel).
    This tells Ubuntu that you've got a middle mouse button, and hence you have no need to emulate it for that particular mouse.
    This has immediate effect - no need to restart X
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	screenshot.png 
Views:	45 
Size:	73.3 KB 
ID:	149548  
    Last edited by Rhubarb; February 1st, 2011 at 11:29 AM. Reason: Added in an adapted udev restart example
    Work smart, not hard.

  2. #2
    Join Date
    May 2008
    Location
    Spain
    Beans
    130
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: HOWTO: Emulate3Buttons = false in Lucid with udev

    worked like a charm

    thanks!

    This is definitely a must for ubuntu. Either you should have an option in some menu to change this, or at least the system should be able to detect if you have a third button mouse and dont activate it by default...

  3. #3
    Join Date
    May 2007
    Location
    Sunnyvale, CA
    Beans
    45
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Emulate3Buttons = false in Lucid with udev

    Hi Rhubarb, perhaps you can help me with my mouse and udev. I'm trying to setup my Logitech Marble mouse using this guide for 10.04 with udev: https://help.ubuntu.com/community/Lo...arblemouse_USB

    I followed these instruction precisely but the issue is no matter what I do the mouse buttons don't behave differently. Its like the udev rule isn't taking effect. Likewise, I followed your set of commands above but the mouse behaved the same before any udev rules were setup. Any suggestions? Thanks in advance.
    Running Ubuntu 11.04 on a HP Pavilion a1750y PentiumD, Nvidia graphics.

  4. #4
    Join Date
    Apr 2006
    Location
    Spain / España
    Beans
    6
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Emulate3Buttons = false in Lucid with udev

    I'm having the same problem, cros157. I'll try to get it to work and report back if I have any success. Anyway, help is welcome!

  5. #5
    Join Date
    May 2007
    Location
    Sunnyvale, CA
    Beans
    45
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Emulate3Buttons = false in Lucid with udev

    Naproxeno, I never did get the udev rules to work. I opt to use xinput. Here's the code:

    Code:
    xinput set-button-map "Logitech USB Trackball" 1 2 3 4 5 6 7 8 9
    xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Button" 8 8
    xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation" 8 1
    xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Axes" 8 6 7 4 5
    xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation X Axis" 8 6
    xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Timeout" 8 200
    xinput set-int-prop "Logitech USB Trackball" "Evdev Drag Lock Buttons" 8 0
    I have to run it each time I reboot, so I setup a shell script on the Desktop.
    Running Ubuntu 11.04 on a HP Pavilion a1750y PentiumD, Nvidia graphics.

  6. #6
    Join Date
    Apr 2006
    Location
    Spain / España
    Beans
    6
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Emulate3Buttons = false in Lucid with udev

    Thanks, cros157!

    Anyway, I think I finally got it working without having to run a script. I'll post the solution here in case somebody need it.

    The Ubuntu Community Help page advise you to write an udev rule to set "x11_options" but I think that's wrong. In the Kubuntu wiki (I use Kubuntu) the following note can be found:

    Note: The x11_options properties are not supported in Ubuntu 10.04. Use xorg.conf.d snippets instead.
    So the key seem to be in these "xorg.conf.d snippets". I couldn't find much information regarding (K)Ubuntu but this page seem to confirm they work in Ubuntu 10.04 and that they will be kept around at least until 10.10. The Fedora wiki has more comprenhensive information.

    According to Fedora, the user can place its snippets either in /etc/X11/xorg.conf.d or /usr/share/X11/xorg.conf.d. However, in Ubuntu it seems that if you put something in /etc/X11/xorg.conf.d the other directory is ignored and you can easily end up with no input devices in X. So, although putting a snippet in /usr/share/X11/xorg.conf.d should have worked, I opted for adding this to my /etc/X11/xorg.conf:

    Code:
    Section "InputClass"
            Identifier  "Marble Mouse"
            MatchProduct "ImExPS/2 Logitech Explorer Mouse"
            MatchIsPointer "on"
            MatchDevicePath "/dev/input/event*"
            Driver "evdev"
            Option "ButtonMapping" "1 8 3 4 5 6 7 2 9"
            Option "EmulateWheel" "true"
            Option "EmulateWheelButton" "8"
            Option "ZAxisMapping" "4 5"
            Option  "XAxisMapping" "6 7"
            Option  "Emulate3Buttons" "false"
    EndSection
    Please note that my Logitech Marble Mouse is recognized as "ImExPS/2 Logitech Explorer Mouse". I have a quite old model so it could be possible for your device to have a different name. You can take a look in your Xorg log to learn its name:

    Code:
    grep Logitech /var/log/Xorg.0.log
    Sorry for the long post. I hope it helps someone.

    I'm going to update the Community Help pages to add this information.
    Last edited by Naproxeno; May 2nd, 2010 at 12:59 PM. Reason: Minor corrections

  7. #7
    Join Date
    Jun 2009
    Beans
    2

    Re: HOWTO: Emulate3Buttons = false in Lucid with udev

    I have a friend who just installed Lucid (the final realease, 32bits) and want to disable this "mouse1+mouse2=mouse3". He just did that but when he click with both button, it still emulates mouse3.

    He has
    $ head /etc/udev/rules.d/mouse-gaming.rules
    ENV{x11_options.Emulate3Buttons}="False"

    So I'm sure he did it well :/

    (he unplugged/plugged, sudo service udev restart and also restart his computer)

  8. #8
    Join Date
    Apr 2006
    Location
    Spain / España
    Beans
    6
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Emulate3Buttons = false in Lucid with udev

    lowje, if the wiki is correct, I think Ubuntu currently ignores "x11_options" in udev. Perhaps your friend could try creating (or editing) /etc/X11/xorg.conf with the following content:

    Code:
    Section "InputClass"
            Identifier  "no 3 button emulation"
            MatchIsPointer "on"
            MatchDevicePath "/dev/input/event*"
            Driver "evdev"
            Option  "Emulate3Buttons" "false"
    EndSection
    I'm not sure it would work. If your friend has any problems, he can delete that code to undo the effects.

    Good luck!

  9. #9
    Join Date
    May 2007
    Location
    Sunnyvale, CA
    Beans
    45
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Emulate3Buttons = false in Lucid with udev

    Naproxeno, your solution of adding Section "InputClass" to xorg.conf worked for me. Thank you.
    Running Ubuntu 11.04 on a HP Pavilion a1750y PentiumD, Nvidia graphics.

  10. #10
    Join Date
    Jun 2009
    Beans
    2

    Re: HOWTO: Emulate3Buttons = false in Lucid with udev

    Your solution works for my friend, Naproxeno. Thanks (one issue less when I will swith to Lucid ^^).

    So, if I well understand, xorg.conf is not used anymore in Lucid but it still work if we had something written on it…
    Last edited by lowje; May 3rd, 2010 at 12:02 AM. Reason: without this comma, this sentence had another sens in English

Page 1 of 2 12 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
  •