aboutsummaryrefslogtreecommitdiff
path: root/src/evdev.h
diff options
context:
space:
mode:
authorChris Salch <emeraldd.chris@gmail.com>2008-08-06 22:08:13 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2008-08-07 16:04:31 +0930
commita9d72b40fbe178fa4fbb9d0e7c02dc6c5250969a (patch)
tree2eccade8fe136a632e5be72332b2145e5af5e6cb /src/evdev.h
parentPrint a warning if a keycode exceeds the range accepted by the server. (diff)
downloadxf86-input-evdev-a9d72b40fbe178fa4fbb9d0e7c02dc6c5250969a.tar.gz
xf86-input-evdev-a9d72b40fbe178fa4fbb9d0e7c02dc6c5250969a.tar.bz2
xf86-input-evdev-a9d72b40fbe178fa4fbb9d0e7c02dc6c5250969a.zip
Adding mouse wheel emulation code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev.h')
-rw-r--r--src/evdev.h20
1 files changed, 20 insertions, 0 deletions
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 <X11/extensions/XKBstr.h>
#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