How to enable/disable the middle button emulation for a mouse when boot

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6 and 7
  • X Window System

Issue

  • I want to disable the middle button emulation for a mouse when boot.
  • Although setting Option "Emulate3Buttons" "False" in InputDevice section in /etc/X11/xorg.conf, it cannot be disabled.

Resolution

The mouse setting is configured to the driver evdev. Create a new file for evdev driver under /etc/X11/xorg.conf.d/ and set the following setting.

 -- /etc/X11/xorg.conf.d/evdev.conf --
Section "InputClass"
        Identifier "evdev mouse"
        MatchDevicePath "/dev/input/event*"
        # If you want to disable the middle button emulation, set the option to "no".
        Option     "Emulate3Buttons" "no"
        # If you want to enable the middle button emulation, set the option to "yes".
        # Option     "Emulate3Buttons" "yes"
        Driver     "evdev"
EndSection

After creating a file, restart the desktop environment (X Window System) to enable the setting.

### In the case of RHEL7
# systemctl restart gdm

### In the case of RHEL6
# initctl stop prefdm
# initctl start prefdm

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments