From a9d72b40fbe178fa4fbb9d0e7c02dc6c5250969a Mon Sep 17 00:00:00 2001 From: Chris Salch Date: Wed, 6 Aug 2008 22:08:13 -0500 Subject: Adding mouse wheel emulation code. Signed-off-by: Peter Hutterer --- src/evdev.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/evdev.h') diff --git a/src/evdev.h b/src/evdev.h index 56983c2..83f03f4 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -40,6 +40,13 @@ #include #endif +/* axis specific data for wheel emulation */ +typedef struct { + int up_button; + int down_button; + int traveled_distance; +} WheelAxis, *WheelAxisPtr; + typedef struct { int kernel24; int screen; @@ -68,6 +75,14 @@ typedef struct { Time expires; /* time of expiry */ Time timeout; } emulateMB; + struct { + BOOL enabled; + int button; + int button_state; + int inertia; + WheelAxis X; + WheelAxis Y; + } emulateWheel; unsigned char btnmap[32]; /* config-file specified button mapping */ } EvdevRec, *EvdevPtr; @@ -89,4 +104,9 @@ Atom EvdevMBEmuInitPropertyTimeout(DeviceIntPtr, char*); BOOL EvdevMBEmuSetProperty(DeviceIntPtr, Atom, XIPropertyValuePtr); #endif +/* Mouse Wheel emulation */ +void EvdevWheelEmuPreInit(InputInfoPtr pInfo); +BOOL EvdevWheelEmuFilterButton(InputInfoPtr pInfo, unsigned int button, int value); +BOOL EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv); + #endif -- cgit v1.2.3