mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-25 05:59:11 +00:00
Fixed bug 3157 - Rudimentary touchscreen support in SDL_evdev (supports Raspberry Pi)
tvc I've spent the last few days implementing touchscreen support in core/linux/SDL_evdev.c. It's fairly rudimentary at the moment, as can be seen from the multiple TODO's and FIXME's littered throughout, but I'm mainly submitting this patch for review. I've tested this patch on my Raspberry Pi 2 with the official touchscreen and it works fantastically, reporting all 10 multitouch points. I'm happy to work on this further, the evdev logic also needs a bit of a cleanup I think (I may have included a few changes). But if it's good enough in its current state to be committed then I'm sure there'd be plenty of people pleased, as currently the only other framework/library that supports touchscreens on the Raspberry Pi is Kivy.
This commit is contained in:
parent
473051f6bb
commit
1a31bbe2c8
4 changed files with 535 additions and 482 deletions
|
@ -27,31 +27,11 @@
|
|||
#ifdef SDL_INPUT_LINUXEV
|
||||
|
||||
#include "SDL_events.h"
|
||||
#include <sys/stat.h>
|
||||
|
||||
typedef struct SDL_evdevlist_item
|
||||
{
|
||||
char *path;
|
||||
int fd;
|
||||
struct SDL_evdevlist_item *next;
|
||||
} SDL_evdevlist_item;
|
||||
|
||||
typedef struct SDL_EVDEV_PrivateData
|
||||
{
|
||||
SDL_evdevlist_item *first;
|
||||
SDL_evdevlist_item *last;
|
||||
int numdevices;
|
||||
int ref_count;
|
||||
int console_fd;
|
||||
int kb_mode;
|
||||
int tty;
|
||||
} SDL_EVDEV_PrivateData;
|
||||
|
||||
extern int SDL_EVDEV_Init(void);
|
||||
extern void SDL_EVDEV_Quit(void);
|
||||
extern void SDL_EVDEV_Poll(void);
|
||||
|
||||
|
||||
#endif /* SDL_INPUT_LINUXEV */
|
||||
|
||||
#endif /* _SDL_evdev_h */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue