aboutsummaryrefslogtreecommitdiff
path: root/src/evdev.h
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-01-26 12:11:00 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-02-08 11:34:51 +1000
commitd9001a6be9d86a5f30549af9fbb02a466f4b0709 (patch)
tree59a126f66fc1d9856e6fa5d235b8bac7cc540d47 /src/evdev.h
parentStatic atoms don't need to be initialized to 0. (diff)
downloadxf86-input-evdev-d9001a6be9d86a5f30549af9fbb02a466f4b0709.tar.gz
xf86-input-evdev-d9001a6be9d86a5f30549af9fbb02a466f4b0709.tar.bz2
xf86-input-evdev-d9001a6be9d86a5f30549af9fbb02a466f4b0709.zip
Add third button emulation.
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 <peter.hutterer@who-t.net> Tested-by: Benjamin Tissoires <tissoire@cena.fr>
Diffstat (limited to 'src/evdev.h')
-rw-r--r--src/evdev.h24
1 files changed, 24 insertions, 0 deletions
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