Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_eventtouch.c @ 4678:f8431f66613d
Added SDL_TouchID, SDL_FingerID, SDL_GestureID types. Converted to integer cioordinates (<- not working).
author | jimtla |
---|---|
date | Sat, 31 Jul 2010 20:02:54 +0400 |
parents | 62e6a6e9720b |
children | 5378f2d0754f |
comparison
equal
deleted
inserted
replaced
4677:31607094315c | 4678:f8431f66613d |
---|---|
54 | 54 |
55 SDL_Touch touch; | 55 SDL_Touch touch; |
56 touch.pressure_max = 0; | 56 touch.pressure_max = 0; |
57 touch.pressure_min = 0; | 57 touch.pressure_min = 0; |
58 touch.id = event; | 58 touch.id = event; |
59 | |
60 | |
61 | |
62 | 59 |
63 | 60 |
64 touch.driverdata = SDL_malloc(sizeof(EventTouchData)); | 61 touch.driverdata = SDL_malloc(sizeof(EventTouchData)); |
65 EventTouchData* data = (EventTouchData*)(touch.driverdata); | 62 EventTouchData* data = (EventTouchData*)(touch.driverdata); |
66 printf("Opening device...\n"); | 63 printf("Opening device...\n"); |
74 | 71 |
75 int abs[5]; | 72 int abs[5]; |
76 ioctl(data->eventStream,EVIOCGABS(0),abs); | 73 ioctl(data->eventStream,EVIOCGABS(0),abs); |
77 touch.x_min = abs[1]; | 74 touch.x_min = abs[1]; |
78 touch.x_max = abs[2]; | 75 touch.x_max = abs[2]; |
79 touch.xres = touch.x_max - touch.x_min; | 76 touch.native_xres = touch.x_max - touch.x_min; |
80 ioctl(data->eventStream,EVIOCGABS(ABS_Y),abs); | 77 ioctl(data->eventStream,EVIOCGABS(ABS_Y),abs); |
81 touch.y_min = abs[1]; | 78 touch.y_min = abs[1]; |
82 touch.y_max = abs[2]; | 79 touch.y_max = abs[2]; |
83 touch.yres = touch.y_max - touch.y_min; | 80 touch.native_yres = touch.y_max - touch.y_min; |
84 ioctl(data->eventStream,EVIOCGABS(ABS_PRESSURE),abs); | 81 ioctl(data->eventStream,EVIOCGABS(ABS_PRESSURE),abs); |
85 touch.pressure_min = abs[1]; | 82 touch.pressure_min = abs[1]; |
86 touch.pressure_max = abs[2]; | 83 touch.pressure_max = abs[2]; |
87 touch.pressureres = touch.pressure_max - touch.pressure_min; | 84 touch.native_pressureres = touch.pressure_max - touch.pressure_min; |
88 | |
89 | 85 |
90 SDL_AddTouch(&touch, tstr); | 86 SDL_AddTouch(&touch, tstr); |
91 | |
92 } | 87 } |
93 vendor = -1; | 88 vendor = -1; |
94 product = -1; | 89 product = -1; |
95 event = -1; | 90 event = -1; |
96 } | 91 } |