1.. _middle_button_emulation: 2 3============================================================================== 4Middle button emulation 5============================================================================== 6 7Middle button emulation provides users with the ability to generate a middle 8click even when the device does not have a physical middle button available. 9 10When middle button emulation is enabled, a simultaneous press of the left 11and right button generates a middle mouse button event. Releasing the 12buttons generates a middle mouse button release, the left and right button 13events are discarded otherwise. 14 15The middle button release event may be generated when either button is 16released, or when both buttons have been released. The exact behavior is 17device-dependent, libinput will implement the behavior that is most 18appropriate to the physical device. 19 20The middle button emulation behavior when combined with other device 21buttons, including a physical middle button is device-dependent. 22For example, :ref:`clickpad_softbuttons` provides a middle button area when 23middle button emulation is disabled. That middle button area disappears 24when middle button emulation is enabled - a middle click can then only be 25triggered by a simultaneous left + right click. 26 27Some devices provide middle mouse button emulation but do not allow 28enabling/disabling that emulation. Likewise, some devices may allow middle 29button emulation but have it disabled by default. This is the case for most 30mouse-like devices where a middle button is detected. 31 32libinput provides **libinput_device_config_middle_emulation_set_enabled()** to 33enable or disable middle button emulation. See :ref:`faq_configure_wayland` 34and :ref:`faq_configure_xorg` for info on how to enable or disable middle 35button emulation in the Wayland compositor or the X stack. 36