From d9001a6be9d86a5f30549af9fbb02a466f4b0709 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 26 Jan 2011 12:11:00 +1000 Subject: Add third button emulation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New properties: "Evdev Third Button Emulation" → switch on/off "Evdev Third Button Emulation Timeout" → timeout until event is delivered "Evdev Third Button Emulation Button" → phys button to be emulated "Evdev Third Button Emulation Threshold" → move threshold before emulation is cancelled Signed-off-by: Peter Hutterer Tested-by: Benjamin Tissoires --- src/evdev.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/evdev.h') diff --git a/src/evdev.h b/src/evdev.h index e68f7f2..5df7d3e 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -136,6 +136,19 @@ typedef struct { Time expires; /* time of expiry */ Time timeout; } emulateMB; + /* Third mouse button emulation */ + struct emulate3B { + BOOL enabled; + BOOL state; /* current state */ + Time timeout; /* timeout until third button press */ + int buttonstate; /* phys. button state */ + int button; /* phys button to emit */ + int threshold; /* move threshold in dev coords */ + OsTimerPtr timer; + int delta[2]; /* delta x/y, accumulating */ + int startpos[2]; /* starting pos for abs devices */ + int flags; /* remember if we had rel or abs movement */ + } emulate3B; struct { int meta; /* meta key to lock any button */ BOOL meta_state; /* meta_button state */ @@ -204,6 +217,16 @@ void EvdevMBEmuPreInit(InputInfoPtr); void EvdevMBEmuOn(InputInfoPtr); void EvdevMBEmuFinalize(InputInfoPtr); +/* Third button emulation */ +CARD32 Evdev3BEmuTimer(OsTimerPtr timer, CARD32 time, pointer arg); +BOOL Evdev3BEmuFilterEvent(InputInfoPtr, int, BOOL); +void Evdev3BEmuPreInit(InputInfoPtr pInfo); +void Evdev3BEmuPreInit(InputInfoPtr); +void Evdev3BEmuOn(InputInfoPtr); +void Evdev3BEmuFinalize(InputInfoPtr); +void Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, int dx, int dy); +void Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals); + /* Mouse Wheel emulation */ void EvdevWheelEmuPreInit(InputInfoPtr pInfo); BOOL EvdevWheelEmuFilterButton(InputInfoPtr pInfo, unsigned int button, int value); @@ -214,6 +237,7 @@ void EvdevDragLockPreInit(InputInfoPtr pInfo); BOOL EvdevDragLockFilterEvent(InputInfoPtr pInfo, unsigned int button, int value); void EvdevMBEmuInitProperty(DeviceIntPtr); +void Evdev3BEmuInitProperty(DeviceIntPtr); void EvdevWheelEmuInitProperty(DeviceIntPtr); void EvdevDragLockInitProperty(DeviceIntPtr); #endif -- cgit v1.2.3