From 24d694f2744e7fad8a1afc51e509f9925613a4b4 Mon Sep 17 00:00:00 2001 From: Kai Krakow Date: Sat, 17 Apr 2021 12:34:38 +0200 Subject: [PATCH] todo! Signed-off-by: Kai Krakow --- hid-xpadneo/src/hid-xpadneo.c | 3 ++- hid-xpadneo/src/xpadneo.h | 1 + hid-xpadneo/src/xpadneo/mouse.c | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hid-xpadneo/src/hid-xpadneo.c b/hid-xpadneo/src/hid-xpadneo.c index 8e5b4347..e38ded5f 100644 --- a/hid-xpadneo/src/hid-xpadneo.c +++ b/hid-xpadneo/src/hid-xpadneo.c @@ -863,7 +863,8 @@ static int xpadneo_raw_event(struct hid_device *hdev, struct hid_report *report, } } - //TODO Maybe intercept mouse mode here + if (xpadneo_mouse_raw_event(xdata, report, data, reportsize)) + return -1; return 0; } diff --git a/hid-xpadneo/src/xpadneo.h b/hid-xpadneo/src/xpadneo.h index afc0d2d8..b9302f92 100644 --- a/hid-xpadneo/src/xpadneo.h +++ b/hid-xpadneo/src/xpadneo.h @@ -195,6 +195,7 @@ extern int xpadneo_init_consumer(struct xpadneo_devdata *); extern int xpadneo_init_mouse(struct xpadneo_devdata *); extern int xpadneo_init_synthetic(struct xpadneo_devdata *, char *, struct input_dev **); extern int xpadneo_mouse_event(struct xpadneo_devdata *, struct hid_usage *, __s32); +extern int xpadneo_mouse_raw_event(struct xpadneo_devdata *, struct hid_report *, u8 *, int) extern void xpadneo_mouse_report(struct timer_list *); extern void xpadneo_toggle_mouse(struct xpadneo_devdata *); diff --git a/hid-xpadneo/src/xpadneo/mouse.c b/hid-xpadneo/src/xpadneo/mouse.c index eeef6896..b1319831 100644 --- a/hid-xpadneo/src/xpadneo/mouse.c +++ b/hid-xpadneo/src/xpadneo/mouse.c @@ -42,6 +42,15 @@ extern void xpadneo_mouse_report(struct timer_list *t) } #define rescale_axis(v,d) (((v)<(d)&&(v)>-(d))?0:(32768*((v)>0?(v)-(d):(v)+(d))/(32768-(d)))) +extern int xpadneo_mouse_raw_event(struct xpadneo_devdata *xdata, struct hid_report *report, + u8 *data, int reportsize) +{ + if (!xdata->mouse_mode) + return 0; +//todo! +} + + extern int xpadneo_mouse_event(struct xpadneo_devdata *xdata, struct hid_usage *usage, __s32 value) { if (!xdata->mouse_mode)