Mercurial > sdl-ios-xcode
diff src/video/x11/SDL_eventtouch.c @ 4646:eea1bf53effa
Added include/touch.h Now reading in resolution of touch pad.
author | Jim Grandpre <jim.tla@gmail.com> |
---|---|
date | Tue, 01 Jun 2010 02:54:33 -0400 |
parents | 0375d020e7e3 |
children | 62e6a6e9720b |
line wrap: on
line diff
--- a/src/video/x11/SDL_eventtouch.c Mon May 31 00:24:37 2010 -0400 +++ b/src/video/x11/SDL_eventtouch.c Tue Jun 01 02:54:33 2010 -0400 @@ -53,7 +53,9 @@ touch.pressure_max = 0; touch.pressure_min = 0; touch.id = event; - + + + touch.driverdata = SDL_malloc(sizeof(EventTouchData)); @@ -64,6 +66,24 @@ O_RDONLY | O_NONBLOCK); ioctl (data->eventStream, EVIOCGNAME (sizeof (tstr)), tstr); printf ("Reading From : %s\n", tstr); + + + + int abs[5]; + ioctl(data->eventStream,EVIOCGABS(0),abs); + touch.x_min = abs[1]; + touch.x_max = abs[2]; + touch.xres = touch.x_max - touch.x_min; + ioctl(data->eventStream,EVIOCGABS(ABS_Y),abs); + touch.y_min = abs[1]; + touch.y_max = abs[2]; + touch.yres = touch.y_max - touch.y_min; + ioctl(data->eventStream,EVIOCGABS(ABS_PRESSURE),abs); + touch.pressure_min = abs[1]; + touch.pressure_max = abs[2]; + touch.pressureres = touch.pressure_max - touch.pressure_min; + + SDL_AddTouch(&touch, tstr); }