Skip to content

Commit

Permalink
todo!
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Krakow <[email protected]>
  • Loading branch information
kakra committed Aug 28, 2021
1 parent d6fc381 commit c6a3c4c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hid-xpadneo/src/hid-xpadneo.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,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;
}
Expand Down
1 change: 1 addition & 0 deletions hid-xpadneo/src/xpadneo.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,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 *);

Expand Down
9 changes: 9 additions & 0 deletions hid-xpadneo/src/xpadneo/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c6a3c4c

Please sign in to comment.