mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
If Emulate3Buttons is specified in the config, don't auto-deactivate it.
Default setting is still "on" until middle button is pressed. If the options is however explicitly stated in the config file, it takes the value from the config file, no matter if a middle button is present.
This commit is contained in:
21
src/emuMB.c
21
src/emuMB.c
@@ -36,6 +36,12 @@
|
||||
|
||||
#include "evdev.h"
|
||||
|
||||
enum {
|
||||
MBEMU_DISABLED = 0,
|
||||
MBEMU_ENABLED,
|
||||
MBEMU_AUTO
|
||||
};
|
||||
|
||||
/*
|
||||
* Lets create a simple finite-state machine for 3 button emulation:
|
||||
*
|
||||
@@ -288,9 +294,17 @@ void
|
||||
EvdevMBEmuPreInit(InputInfoPtr pInfo)
|
||||
{
|
||||
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
||||
pEvdev->emulateMB.enabled = MBEMU_AUTO;
|
||||
|
||||
if (xf86FindOption(pInfo->options, "Emulate3Buttons"))
|
||||
{
|
||||
pEvdev->emulateMB.enabled = xf86SetBoolOption(pInfo->options,
|
||||
"Emulate3Buttons",
|
||||
MBEMU_ENABLED);
|
||||
xf86Msg(X_INFO, "%s: Forcing middle mouse button emulation.\n",
|
||||
pInfo->name);
|
||||
}
|
||||
|
||||
pEvdev->emulateMB.enabled = xf86SetBoolOption(pInfo->options,
|
||||
"Emulate3Buttons", TRUE);
|
||||
pEvdev->emulateMB.timeout = xf86SetIntOption(pInfo->options,
|
||||
"Emulate3Timeout", 50);
|
||||
RegisterBlockAndWakeupHandlers (EvdevMBEmuBlockHandler,
|
||||
@@ -313,5 +327,6 @@ void
|
||||
EvdevMBEmuEnable(InputInfoPtr pInfo, BOOL enable)
|
||||
{
|
||||
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
||||
pEvdev->emulateMB.enabled = enable;
|
||||
if (pEvdev->emulateMB.enabled == MBEMU_AUTO)
|
||||
pEvdev->emulateMB.enabled = enable;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user