tizen 2.4 release
[adaptation/xorg/driver/xserver-xorg-input-evdev.git] / src / evdev.h
1 /*
2  * Copyright © 2004-2008 Red Hat, Inc.
3  * Copyright © 2008 University of South Australia
4  *
5  * Permission to use, copy, modify, distribute, and sell this software
6  * and its documentation for any purpose is hereby granted without
7  * fee, provided that the above copyright notice appear in all copies
8  * and that both that copyright notice and this permission notice
9  * appear in supporting documentation, and that the name of Red Hat
10  * not be used in advertising or publicity pertaining to distribution
11  * of the software without specific, written prior permission.  Red
12  * Hat makes no representations about the suitability of this software
13  * for any purpose.  It is provided "as is" without express or implied
14  * warranty.
15  *
16  * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
18  * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
20  * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
21  * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
22  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23  *
24  * Authors:
25  *      Kristian Høgsberg (krh@redhat.com)
26  *      Adam Jackson (ajax@redhat.com)
27  *      Peter Hutterer (peter@cs.unisa.edu.au)
28  *      Oliver McFadden (oliver.mcfadden@nokia.com)
29  */
30
31 #ifdef HAVE_CONFIG_H
32 #include "config.h"
33 #endif
34
35 #ifndef EVDEV_H
36 #define EVDEV_H
37
38 #include <linux/input.h>
39 #include <linux/types.h>
40
41 #include <xorg-server.h>
42 #include <xf86Xinput.h>
43 #include <xf86_OSproc.h>
44 #include <xkbstr.h>
45
46 #ifdef MULTITOUCH
47 #include <mtdev.h>
48 #endif
49
50 #ifdef ENABLE_TTRACE
51 #include <ttrace.h>
52
53 #define TTRACE_BEGIN(NAME) traceBegin(TTRACE_TAG_INPUT, NAME)
54 #define TTRACE_END() traceEnd(TTRACE_TAG_INPUT)
55 #else //ENABLE_TTRACE
56 #define TTRACE_BEGIN(NAME)
57 #define TTRACE_END()
58 #endif //ENABLE_TTRACE
59
60 #ifdef _F_GESTURE_EXTENSION_
61 typedef enum _MTSyncType
62 {
63     MTOUCH_FRAME_SYNC_END,
64     MTOUCH_FRAME_SYNC_BEGIN,
65     MTOUCH_FRAME_SYNC_UPDATE,
66     ROTARY_FRAME_SYNC_END,
67     ROTARY_FRAME_SYNC_BEGIN
68 } MTSyncType;
69
70 enum EventType
71 {
72 #ifdef _F_PROXY_DEVICE_ENABLED_
73     ET_Motion = 6,
74     ET_DeviceChanged = 17,
75     ET_RawMotion = 24,
76 #endif /* #ifdef _F_PROXY_DEVICE_ENABLED_ */
77     ET_MTSync = 0x7E,
78     ET_Internal = 0xFF /* First byte */
79 };
80
81 typedef struct _AnyEvent AnyEvent;
82 struct _AnyEvent
83 {
84     unsigned char header; /**< Always ET_Internal */
85     enum EventType type;  /**< One of EventType */
86     int length;           /**< Length in bytes */
87     Time time;            /**< Time in ms */
88     int deviceid;
89     MTSyncType sync;
90     int x;
91     int y;
92 };
93
94 #ifdef _F_PROXY_DEVICE_ENABLED_
95
96 #define DEVCHANGE_SLAVE_SWITCH 0x2
97 #define DEVCHANGE_KEYBOARD_EVENT 0x8
98
99 struct _DeviceChangedEvent {
100     unsigned char header; /**< Always ET_Internal */
101     enum EventType type;  /**< ET_DeviceChanged */
102     int length;           /**< Length in bytes */
103     Time time;            /**< Time in ms */
104     int deviceid;         /**< Device whose capabilities have changed */
105     int flags;            /**< Mask of ::HAS_NEW_SLAVE,
106                                ::POINTER_EVENT, ::KEYBOARD_EVENT */
107     int masterid;         /**< MD when event was generated */
108     int sourceid;         /**< The device that caused the change */
109
110     struct {
111         int num_buttons;        /**< Number of buttons */
112         Atom names[MAX_BUTTONS];/**< Button names */
113     } buttons;
114
115     int num_valuators;          /**< Number of axes */
116     struct {
117         uint32_t min;           /**< Minimum value */
118         uint32_t max;           /**< Maximum value */
119         double value;           /**< Current value */
120         /* FIXME: frac parts of min/max */
121         uint32_t resolution;    /**< Resolution counts/m */
122         uint8_t mode;           /**< Relative or Absolute */
123         Atom name;              /**< Axis name */
124         ScrollInfo scroll;      /**< Smooth scrolling info */
125     } valuators[MAX_VALUATORS];
126
127     struct {
128         int min_keycode;
129         int max_keycode;
130     } keys;
131 };
132 #endif /* #ifdef _F_PROXY_DEVICE_ENABLED_ */
133
134 union _InternalEvent {
135         struct {
136             unsigned char header; /**< Always ET_Internal */
137             enum EventType type;  /**< One of ET_* */
138             int length;           /**< Length in bytes */
139             Time time;            /**< Time in ms. */
140         } any;
141         AnyEvent any_event;
142 #ifdef _F_PROXY_DEVICE_ENABLED_
143     DeviceChangedEvent changed_event;
144 #endif /* #ifdef _F_PROXY_DEVICE_ENABLED_ */
145 };
146
147 #define GESTURE_DEV_NAME "Gesture"
148 /* Gesture driver will query devices information
149   * if a gesture driver's control function is called using DEVICE_READY*/
150 #define DEVICE_READY 11
151
152 #endif /* #ifdef _F_GESTURE_EXTENSION_ */
153
154 #ifndef EV_CNT /* linux 2.6.23 kernels and earlier lack _CNT defines */
155 #define EV_CNT (EV_MAX+1)
156 #endif
157 #ifndef KEY_CNT
158 #define KEY_CNT (KEY_MAX+1)
159 #endif
160 #ifndef REL_CNT
161 #define REL_CNT (REL_MAX+1)
162 #endif
163 #ifndef ABS_CNT
164 #define ABS_CNT (ABS_MAX+1)
165 #endif
166 #ifndef LED_CNT
167 #define LED_CNT (LED_MAX+1)
168 #endif
169
170 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 14
171 #define HAVE_SMOOTH_SCROLLING 1
172 #endif
173
174 #define EVDEV_MAXBUTTONS 32
175 #define EVDEV_MAXQUEUE 32
176
177 #define EVDEV_PRESS 1
178 #define EVDEV_RELEASE 0
179
180 #ifdef _ENV_TV_
181 #define EVDEV_RMS_TIMEOUT 5000
182 #else
183 #define EVDEV_RMS_TIMEOUT 15000
184 #endif //_ENV_TV_
185
186 /* evdev flags */
187 #define EVDEV_KEYBOARD_EVENTS   (1 << 0)
188 #define EVDEV_BUTTON_EVENTS     (1 << 1)
189 #define EVDEV_RELATIVE_EVENTS   (1 << 2)
190 #define EVDEV_ABSOLUTE_EVENTS   (1 << 3)
191 #define EVDEV_TOUCHPAD          (1 << 4)
192 #define EVDEV_INITIALIZED       (1 << 5) /* WheelInit etc. called already? */
193 #define EVDEV_TOUCHSCREEN       (1 << 6)
194 #define EVDEV_CALIBRATED        (1 << 7) /* run-time calibrated? */
195 #define EVDEV_TABLET            (1 << 8) /* device looks like a tablet? */
196 #define EVDEV_UNIGNORE_ABSOLUTE (1 << 9) /* explicitly unignore abs axes */
197 #define EVDEV_UNIGNORE_RELATIVE (1 << 10) /* explicitly unignore rel axes */
198 #define EVDEV_RELATIVE_MODE     (1 << 11) /* Force relative events for devices with absolute axes */
199 #ifdef _F_EVDEV_CONFINE_REGION_
200 #define EVDEV_CONFINE_REGION    (1 << 12)
201 #endif /* #ifdef _F_EVDEV_CONFINE_REGION_ */
202 #ifdef _F_EVDEV_SUPPORT_GAMEPAD
203 #define EVDEV_GAMEPAD   (1 << 13)
204
205 #define MAX_GAMEPAD_DEFINITION_ABS 3
206 #define MAX_GAMEPAD_DEFINITION_KEY 10
207 #endif //_F_EVDEV_SUPPORT_GAMEPAD
208
209 #ifdef _F_EVDEV_SUPPORT_ROTARY_
210 #define EVDEV_OFM  (1 << 14)
211 #define EVDEV_HALLIC (1 << 15)
212
213 #define DEFAULT_HW_ROTARY_MAX 4360
214 #endif //_F_EVDEV_SUPPORT_ROTARY_
215
216 #ifdef _F_EVDEV_SUPPORT_SMARTRC_
217 #define EVDEV_SMART_RC  (1 << 16) /* air touch mouse is special remote controller for smart tv */
218 #define AIR_TOUCH_MOUSE "Advanced Touch REMOTE"
219 #endif //_F_EVDEV_SUPPORT_SMARTRC_
220
221 #ifndef MAX_VALUATORS
222 #define MAX_VALUATORS 36
223 #endif
224
225 #ifndef XI_PROP_DEVICE_NODE
226 #define XI_PROP_DEVICE_NODE "Device Node"
227 #endif
228
229 #ifndef XI_PROP_DEVICE_TYPE
230 #define XI_PROP_DEVICE_TYPE "Device Type"
231 #endif
232
233 #ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_
234 #define XI_PROP_REL_MOVE_STATUS "Relative Move Status"
235 #define XI_PROP_REL_MOVE_ACK "Relative Move Acknowledge"
236 #endif /* #ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_ */
237 #ifdef _F_BLOCK_MOTION_DEVICE_
238 #define XI_PROP_BLOCK_MOTION_DEVICE "Block Motion Device" /*Atom to block motion device */
239 #endif //_F_BLOCK_MOTION_DEVICE_
240 #ifdef _F_PICTURE_OFF_MODE_ENABLE_
241 #define XI_PROP_PICTURE_OFF_MODE "PICTURE_OFF_MODE" /* Atom to check picture off mode */
242 #endif //_F_PICTURE_OFF_MODE_ENABLE_
243
244 #ifdef _F_PROXY_DEVICE_ENABLED_
245 #define XI_PROP_USE_PROXY_SLAVE_DEVICE "Use Proxy Slave Device"
246 #endif /* #ifdef _F_PROXY_DEVICE_ENABLED_ */
247
248 #define XI_PROP_UNGRAB_DEVICE "Ungrab Device"
249
250 #define LONG_BITS (sizeof(long) * 8)
251
252 /* Number of longs needed to hold the given number of bits */
253 #define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
254
255 /* Function key mode */
256 enum fkeymode {
257     FKEYMODE_UNKNOWN = 0,
258     FKEYMODE_FKEYS,       /* function keys send function keys */
259     FKEYMODE_MMKEYS,      /* function keys send multimedia keys */
260 };
261
262 enum SlotState {
263     SLOTSTATE_OPEN = 8,
264     SLOTSTATE_CLOSE,
265     SLOTSTATE_UPDATE,
266     SLOTSTATE_EMPTY,
267 };
268
269 enum ButtonAction {
270     BUTTON_RELEASE = 0,
271     BUTTON_PRESS = 1
272 };
273
274 /* axis specific data for wheel emulation */
275 typedef struct {
276     int up_button;
277     int down_button;
278     int traveled_distance;
279 } WheelAxis, *WheelAxisPtr;
280
281 #ifdef _F_MULTI_PASSIVE_GRAB_
282 typedef struct _ActivatedKeyList
283 {
284     CARD8 keycode;
285     struct xorg_list list;
286 } ActivatedKeyList;
287 #endif //_F_MULTI_PASSIVE_GRAB_
288
289 /* Event queue used to defer keyboard/button events until EV_SYN time. */
290 typedef struct {
291     enum {
292         EV_QUEUE_KEY,   /* xf86PostKeyboardEvent() */
293         EV_QUEUE_BTN,   /* xf86PostButtonEvent() */
294         EV_QUEUE_PROXIMITY, /* xf86PostProximityEvent() */
295 #ifdef MULTITOUCH
296         EV_QUEUE_TOUCH, /*xf86PostTouchEvent() */
297 #endif
298     } type;
299     union {
300         int key;        /* May be either a key code or button number. */
301 #ifdef MULTITOUCH
302         unsigned int touch; /* Touch ID */
303 #endif
304     } detail;
305     int val;    /* State of the key/button/touch; pressed or released. */
306 #ifdef MULTITOUCH
307     ValuatorMask *touchMask;
308 #endif
309 } EvdevEventQueueRec, *EvdevEventQueuePtr;
310
311 #ifdef _F_REMAP_KEYS_
312 typedef struct {
313     uint8_t cd[256];
314 } EvdevKeyRemapSlice;
315 typedef struct {
316     EvdevKeyRemapSlice* sl[256];
317 } EvdevKeyRemap, *EvdevKeyRemapPtr;
318 #endif //_F_REMAP_KEYS_
319
320 typedef struct {
321 #ifdef _F_MULTI_PASSIVE_GRAB_
322     ActivatedKeyList *activatedkeylist;
323 #endif //_F_MULTI_PASSIVE_GRAB_
324
325     unsigned short id_vendor;
326     unsigned short id_product;
327
328     char *device;
329     int grabDevice;         /* grab the event device? */
330
331     int num_vals;           /* number of valuators */
332     int num_mt_vals;        /* number of multitouch valuators */
333     int axis_map[max(ABS_CNT, REL_CNT)]; /* Map evdev <axis> to index */
334     ValuatorMask *vals;     /* new values coming in */
335     ValuatorMask *old_vals; /* old values for calculating relative motion */
336     ValuatorMask *prox;     /* last values set while not in proximity */
337     ValuatorMask *mt_mask;
338     ValuatorMask **last_mt_vals;
339     int cur_slot;
340     enum SlotState slot_state;
341 #ifdef MULTITOUCH
342     struct mtdev *mtdev;
343 #endif
344
345     int flags;
346     int in_proximity;           /* device in proximity */
347     int use_proximity;          /* using the proximity bit? */
348     int num_buttons;            /* number of buttons */
349     BOOL swap_axes;
350     BOOL invert_x;
351     BOOL invert_y;
352
353     int delta[REL_CNT];
354     unsigned int abs_queued, rel_queued, prox_queued;
355
356     /* XKB stuff has to be per-device rather than per-driver */
357     XkbRMLVOSet rmlvo;
358
359     /* Middle mouse button emulation */
360     struct {
361         BOOL                enabled;
362         BOOL                pending;     /* timer waiting? */
363         int                 buttonstate; /* phys. button state */
364         int                 state;       /* state machine (see bt3emu.c) */
365         Time                expires;     /* time of expiry */
366         Time                timeout;
367     } emulateMB;
368     /* Third mouse button emulation */
369     struct emulate3B {
370         BOOL                enabled;
371         BOOL                state;       /* current state */
372         Time                timeout;     /* timeout until third button press */
373         int                 buttonstate; /* phys. button state */
374         int                 button;      /* phys button to emit */
375         int                 threshold;   /* move threshold in dev coords */
376         OsTimerPtr          timer;
377         int                 delta[2];    /* delta x/y, accumulating */
378         int                 startpos[2]; /* starting pos for abs devices */
379         int                 flags;       /* remember if we had rel or abs movement */
380     } emulate3B;
381     struct {
382         int                 meta;           /* meta key to lock any button */
383         BOOL                meta_state;     /* meta_button state */
384         unsigned int        lock_pair[EVDEV_MAXBUTTONS];  /* specify a meta/lock pair */
385         BOOL                lock_state[EVDEV_MAXBUTTONS]; /* state of any locked buttons */
386     } dragLock;
387     struct {
388         BOOL                enabled;
389         int                 button;
390         int                 button_state;
391         int                 inertia;
392         WheelAxis           X;
393         WheelAxis           Y;
394         Time                expires;     /* time of expiry */
395         Time                timeout;
396     } emulateWheel;
397     /* run-time calibration */
398     struct {
399         int                 min_x;
400         int                 max_x;
401         int                 min_y;
402         int                 max_y;
403     } calibration;
404
405     unsigned char btnmap[32];           /* config-file specified button mapping */
406
407 #ifdef _F_REMAP_KEYS_
408     EvdevKeyRemapPtr keyremap;
409 #endif //_F_REMAP_KEYS_
410
411     int reopen_attempts; /* max attempts to re-open after read failure */
412     int reopen_left;     /* number of attempts left to re-open the device */
413     OsTimerPtr reopen_timer;
414
415 #ifdef _F_EVDEV_CONFINE_REGION_
416     //Backup pointer(s) for cursor
417     CursorLimitsProcPtr pOrgCursorLimits;
418     ConstrainCursorProcPtr pOrgConstrainCursor;
419
420     //Confining information
421     int confined_id;
422     BoxPtr pointer_confine_region;
423 #endif /* #ifdef _F_EVDEV_CONFINE_REGION_ */
424 #ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_
425     BOOL rel_move_status;
426     BOOL rel_move_prop_set;
427     int rel_move_ack;
428     OsTimerPtr rel_move_timer;
429 #endif /* #ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_ */
430     Bool block_handler_registered;
431 #ifdef _F_GESTURE_EXTENSION_
432     int *mt_status;
433 #endif /* #ifdef _F_GESTURE_EXTENSION_ */
434
435 #ifdef _F_TOUCH_TRANSFORM_MATRIX_
436     float transform[9];
437     BOOL use_transform;
438     struct pixman_transform inv_transform;
439 #endif /* #ifdef _F_TOUCH_TRANSFORM_MATRIX_ */
440
441     /* Cached info from device. */
442     char name[1024];
443     unsigned long bitmask[NLONGS(EV_CNT)];
444     unsigned long key_bitmask[NLONGS(KEY_CNT)];
445     unsigned long rel_bitmask[NLONGS(REL_CNT)];
446     unsigned long abs_bitmask[NLONGS(ABS_CNT)];
447     unsigned long led_bitmask[NLONGS(LED_CNT)];
448     struct input_absinfo absinfo[ABS_CNT];
449 #ifdef _F_EVDEV_SUPPORT_GAMEPAD
450     int pre_hatx;
451     int pre_haty;
452     int pre_x;
453     int pre_y;
454     int keycode_btnA;
455     int keycode_btnB;
456     int keycode_btnX;
457     int keycode_btnY;
458     int keycode_btnTL;
459     int keycode_btnTR;
460     int keycode_btnStart;
461     int keycode_btnSelect;
462     int keycode_btnPlay;
463
464     BOOL support_directional_key;
465
466     int abs_gamepad_labels[MAX_GAMEPAD_DEFINITION_ABS];
467     int key_gamepad_labels[MAX_GAMEPAD_DEFINITION_KEY];
468 #endif//_F_EVDEV_SUPPORT_GAMEPAD
469
470 #ifdef _F_USE_DEFAULT_XKB_RULES_
471     BOOL use_default_xkb_rmlvo;
472 #endif//_F_USE_DEFAULT_XKB_RULES_
473
474 #ifdef _F_SUPPORT_ROTATION_ANGLE_
475     int rotation_angle;
476     int rotation_node;
477 #endif// _F_SUPPORT_ROTATION_ANGLE_
478
479     /* minor/major number */
480     dev_t min_maj;
481
482     /* Event queue used to defer keyboard/button events until EV_SYN time. */
483     int                     num_queue;
484     EvdevEventQueueRec           queue[EVDEV_MAXQUEUE];
485
486     enum fkeymode           fkeymode;
487
488 #ifdef _F_EVDEV_SUPPORT_ROTARY_
489     void (*extra_rel_post_ofm) (InputInfoPtr pInfo, int num_v, int first_v, int v[MAX_VALUATORS]);
490     void (*extra_rel_post_hallic) (InputInfoPtr pInfo, int num_v, int first_v, int v[MAX_VALUATORS]);
491     int HW_Calibration;
492 #endif //_F_EVDEV_SUPPORT_ROTARY_
493 #ifdef _F_EVDEV_SUPPORT_SMARTRC_
494     int rc_state;
495 #ifdef _F_SMART_RC_CHG_KBD_SRC_DEV_
496     int (*extra_input_process) (InputInfoPtr *ppInfo, struct input_event *ev);
497 #else
498     int (*extra_input_process) (InputInfoPtr pInfo, struct input_event *ev);
499 #endif
500     void (*origin_input_process) (InputInfoPtr pInfo, struct input_event *ev);
501 #endif //_F_EVDEV_SUPPORT_SMARTRC_
502
503 #ifdef _F_PROXY_DEVICE_ENABLED_
504     Bool proxy_enabled;
505     Bool b_proxy_device;
506     InputInfoPtr proxy_device;
507 #endif //_F_PROXY_DEVICE_ENABLED_
508 } EvdevRec, *EvdevPtr;
509
510 /* Event posting functions */
511 void EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value);
512 void EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value);
513 void EvdevQueueProximityEvent(InputInfoPtr pInfo, int value);
514 #ifdef MULTITOUCH
515 void EvdevQueueTouchEvent(InputInfoPtr pInfo, unsigned int touch,
516                           ValuatorMask *mask, uint16_t type);
517 #endif
518 void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, enum ButtonAction act);
519 void EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count);
520 void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
521                                    int v[MAX_VALUATORS]);
522 void EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
523                                    int v[MAX_VALUATORS]);
524 unsigned int EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code);
525
526 /* Middle Button emulation */
527 int  EvdevMBEmuTimer(InputInfoPtr);
528 BOOL EvdevMBEmuFilterEvent(InputInfoPtr, int, BOOL);
529 void EvdevMBEmuWakeupHandler(pointer, int, pointer);
530 void EvdevMBEmuBlockHandler(pointer, struct timeval**, pointer);
531 void EvdevMBEmuPreInit(InputInfoPtr);
532 void EvdevMBEmuOn(InputInfoPtr);
533 void EvdevMBEmuFinalize(InputInfoPtr);
534
535 /* Third button emulation */
536 CARD32 Evdev3BEmuTimer(OsTimerPtr timer, CARD32 time, pointer arg);
537 BOOL Evdev3BEmuFilterEvent(InputInfoPtr, int, BOOL);
538 void Evdev3BEmuPreInit(InputInfoPtr pInfo);
539 void Evdev3BEmuOn(InputInfoPtr);
540 void Evdev3BEmuFinalize(InputInfoPtr);
541 void Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, int dx, int dy);
542 void Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals);
543
544 /* Mouse Wheel emulation */
545 void EvdevWheelEmuPreInit(InputInfoPtr pInfo);
546 BOOL EvdevWheelEmuFilterButton(InputInfoPtr pInfo, unsigned int button, int value);
547 BOOL EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv);
548
549 /* Draglock code */
550 void EvdevDragLockPreInit(InputInfoPtr pInfo);
551 BOOL EvdevDragLockFilterEvent(InputInfoPtr pInfo, unsigned int button, int value);
552
553 void EvdevMBEmuInitProperty(DeviceIntPtr);
554 void Evdev3BEmuInitProperty(DeviceIntPtr);
555 void EvdevWheelEmuInitProperty(DeviceIntPtr);
556 void EvdevDragLockInitProperty(DeviceIntPtr);
557 void EvdevAppleInitProperty(DeviceIntPtr);
558 #ifdef _F_EVDEV_SUPPORT_ROTARY_
559 void EvdevRotaryInit(DeviceIntPtr device);
560 void EvdevRotaryUnInit(EvdevPtr pEvdev);
561 #endif //_F_EVDEV_SUPPORT_ROTARY_
562 #ifdef _F_EVDEV_SUPPORT_GAMEPAD
563 static void EvdevMappingGamepadAbsToKey(InputInfoPtr pInfo,  struct input_event *ev);
564 static void EvdevMappingGamepadKeyToKey(InputInfoPtr pInfo,  struct input_event *ev);
565 static int EvdevIsGamePad(InputInfoPtr pInfo);
566 #endif//_F_EVDEV_SUPPORT_GAMEPAD
567 static void EvdevProcessEvent(InputInfoPtr pInfo, struct input_event *ev);
568 #ifdef _F_USE_DEFAULT_XKB_RULES_
569 void EvdevGetXkbRules(DeviceIntPtr device, XkbRMLVOSet * rmlvo);
570 #endif //_F_USE_DEFAULT_XKB_RULES_
571 #ifdef _F_EVDEV_SUPPORT_SMARTRC_
572 void EvdevRCInit(DeviceIntPtr device);
573 #endif //_F_EVDEV_SUPPORT_SMARTRC_
574 #ifdef _F_PROXY_DEVICE_ENABLED_
575 void EvdevProxyInit(DeviceIntPtr device);
576 #endif //_F_PROXY_DEVICE_ENABLED_
577 #endif