diff options
Diffstat (limited to 'driver/xf86-input-ws/src/ws.h')
-rw-r--r-- | driver/xf86-input-ws/src/ws.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/driver/xf86-input-ws/src/ws.h b/driver/xf86-input-ws/src/ws.h index 6aaee9061..512648c2a 100644 --- a/driver/xf86-input-ws/src/ws.h +++ b/driver/xf86-input-ws/src/ws.h @@ -33,20 +33,29 @@ extern int ws_debug_level; #define WS_NOMAP 0 +/* axis specific data for wheel */ +typedef struct { + int negative; + int positive; + int traveled_distance; +} WheelAxis, *WheelAxisPtr; + typedef struct WSDevice { char *devName; /* device name */ int type; /* ws device type */ unsigned int buttons; /* # of buttons */ unsigned int lastButtons; /* last state of buttons */ + int old_ax, old_ay; int min_x, max_x, min_y, max_y; /* coord space */ int swap_axes; int raw; int inv_x, inv_y; int screen_no; pointer buffer; - int negativeZ, positiveZ; /* mappings for Z axis */ - int negativeW, positiveW; /* mappings for W axis */ + WheelAxis Z; + WheelAxis W; struct wsmouse_calibcoords coords; /* mirror of the kernel values */ + /* Middle mouse button emulation */ struct { BOOL enabled; @@ -56,8 +65,21 @@ typedef struct WSDevice { Time expires; /* time of expiry */ Time timeout; } emulateMB; + + /* Mouse wheel emulation */ + struct { + BOOL enabled; + int button; + int button_state; + int inertia; + WheelAxis X; + WheelAxis Y; + Time expires; /* time of expiry */ + Time timeout; + } emulateWheel; } WSDeviceRec, *WSDevicePtr; +/* Middle mouse button emulation */ extern int wsmbEmuTimer(InputInfoPtr); extern BOOL wsmbEmuFilterEvent(InputInfoPtr, int, BOOL); extern void wsmbEmuWakeupHandler(pointer, int, pointer); @@ -66,3 +88,12 @@ extern void wsmbEmuPreInit(InputInfoPtr); extern void wsmbEmuOn(InputInfoPtr); extern void wsmbEmuFinalize(InputInfoPtr); extern void wsmbEmuInitProperty(DeviceIntPtr); + +/* Mouse wheel emulation */ +extern void wsWheelEmuPreInit(InputInfoPtr); +extern BOOL wsWheelEmuFilterButton(InputInfoPtr, unsigned int, int); +extern BOOL wsWheelEmuFilterMotion(InputInfoPtr, int, int); +extern void wsWheelEmuInitProperty(DeviceIntPtr); + +extern void wsWheelHandleButtonMap(InputInfoPtr, WheelAxisPtr, char *, char *); +extern void wsButtonClicks(InputInfoPtr, int, int); |