diff options
author | Zephaniah E. Hull <warp@agamemnon.b5> | 2007-06-06 04:41:54 -0400 |
---|---|---|
committer | Zephaniah E. Hull <warp@agamemnon.b5> | 2007-06-06 04:41:54 -0400 |
commit | f15636ac529481a9d83e0250ff89690296f96a3d (patch) | |
tree | 05ee199bf76f8479b6a9261c0a8a351d19bab6fe /src/evdev.h | |
parent | Fix REL mode. (diff) | |
download | xf86-input-evdev-f15636ac529481a9d83e0250ff89690296f96a3d.tar.gz xf86-input-evdev-f15636ac529481a9d83e0250ff89690296f96a3d.tar.bz2 xf86-input-evdev-f15636ac529481a9d83e0250ff89690296f96a3d.zip |
Wheel mice work again!
(Old configs don't.)
evdev.c:
Add EvdevParseMapToButton and EvdevParseMapToButtons to evdev_map_parsers.
Add EvdevParseMapOption to search through evdev_map_parsers.
Fix up EvdevTokenize to handle the evdev_option_token_t changes.
EvdevAxesNew0 after BtnNew0 instead of before now.
(This isn't the right fix.)
evdev.h:
EVDEV_MAXBUTTONS -> BTN_MAX.
Redid evdevBtnRec with the new mapping goodness.
Removed v_min and v_max from evdevAbsRec.
Reworked evdev_option_token_t, no union, no is_chain.
If it's a chain, it still has a string, but the chain pointer is set.
EvdevParseMapToButton, EvdevParseMapToButtons, and EvdevParseMapOption.
evdev_axes.c:
Kill off EvdevAxesMapButton, a variant lives in evdev_btn.c now.
Changes for the evdev_option_token_t changes.
Use EvdevParseMapOption instead of repeating the contents twice.
Disable EV_ABS_V_INVERT for the moment. (Better fix maybe needed.)
evdev_btn.c:
s/Ptr /Rec */g
EvdevMapButton and parser.
EvdevMapButtons and parser.
Nuke EvdevBtnCalcRemap as a whole.
Move everything but the alloc to New1 from New0.
New mapping code, same guts os the axes mapping code even.
Diffstat (limited to 'src/evdev.h')
-rw-r--r-- | src/evdev.h | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/evdev.h b/src/evdev.h index cfce03b..d14bba3 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -80,7 +80,7 @@ #define AXES_MAX ABS_MAX -#define EVDEV_MAXBUTTONS 96 +#define BTN_MAX 96 struct _evdevDevice; @@ -104,16 +104,15 @@ typedef struct { unsigned long ff[NBITS(FF_MAX)]; } evdevBitsRec, *evdevBitsPtr; -#define EV_BTN_IGNORE_X 1 -#define EV_BTN_IGNORE_EVDEV 2 -#define EV_BTN_IGNORE_MAP (EV_BTN_IGNORE_X | EV_BTN_IGNORE_EVDEV) +#define EV_BTN_B_PRESENT (1<<0) typedef struct { int real_buttons; int buttons; - CARD8 ignore[EVDEV_MAXBUTTONS]; - CARD8 map[EVDEV_MAXBUTTONS]; - void (*callback[EVDEV_MAXBUTTONS])(InputInfoPtr pInfo, int button, int value); + int b_flags[BTN_MAX]; + void *b_map_data[ABS_MAX]; + evdev_map_func_f b_map[BTN_MAX]; + void (*callback[BTN_MAX])(InputInfoPtr pInfo, int button, int value); } evdevBtnRec, *evdevBtnPtr; #define EV_ABS_V_PRESENT (1<<0) @@ -132,8 +131,6 @@ typedef struct { int axes; int v[ABS_MAX]; int v_flags[ABS_MAX]; - int v_min[ABS_MAX]; - int v_max[ABS_MAX]; void *v_map_data[ABS_MAX]; evdev_map_func_f v_map[ABS_MAX]; } evdevAbsRec, *evdevAbsPtr; @@ -233,11 +230,8 @@ void EvdevKeyProcess (InputInfoPtr pInfo, struct input_event *ev); */ typedef struct evdev_option_token_s { - int is_chain; - union { - const char *str; - struct evdev_option_token_s *chain; - } u; + const char *str; + struct evdev_option_token_s *chain; struct evdev_option_token_s *next; } evdev_option_token_t; @@ -247,7 +241,7 @@ typedef Bool (*evdev_parse_map_func_f)(InputInfoPtr pInfo, evdev_option_token_t *option, void **map_data, evdev_map_func_f *map_func); -evdev_option_token_t *EvdevTokenize (const char *option, const char *tokens, const char *first); +evdev_option_token_t *EvdevTokenize (const char *option, const char *tokens); void EvdevFreeTokens (evdev_option_token_t *token); Bool EvdevParseMapToRelAxis (InputInfoPtr pInfo, const char *name, @@ -257,6 +251,16 @@ Bool EvdevParseMapToAbsAxis (InputInfoPtr pInfo, const char *name, evdev_option_token_t *option, void **map_data, evdev_map_func_f *map_func); +Bool +EvdevParseMapToButton (InputInfoRec *pInfo, + const char *name, + evdev_option_token_t *option, + void **map_data, evdev_map_func_f *map_func); +Bool +EvdevParseMapToButtons (InputInfoRec *pInfo, + const char *name, + evdev_option_token_t *option, + void **map_data, evdev_map_func_f *map_func); typedef struct { char *name; @@ -264,5 +268,6 @@ typedef struct { } evdev_map_parsers_t; extern evdev_map_parsers_t evdev_map_parsers[]; +Bool EvdevParseMapOption (InputInfoRec *pInfo, char *option, char *def, void **map_data, evdev_map_func_f *map_func); #endif /* __EVDEV_H */ |