X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvideo%2Fomapdss%2Fsdlif.c;h=b33aa0fc9aa2b284df4112c3e234641aeb831b14;hb=17e19802bcb08b2a79e39f84e93750f912f56609;hp=dc97a0a533d06932d79072d130292af47d0d5fff;hpb=9a8e84f82ce2d22a033605d293eb8ba3a4936398;p=sdl_omap.git diff --git a/src/video/omapdss/sdlif.c b/src/video/omapdss/sdlif.c index dc97a0a..b33aa0f 100644 --- a/src/video/omapdss/sdlif.c +++ b/src/video/omapdss/sdlif.c @@ -56,6 +56,7 @@ static void omap_VideoQuit(SDL_VideoDevice *this) oshide_finish(); } this->screen->pixels = NULL; + omapsdl_input_finish(); } static SDL_Rect **omap_ListModes(SDL_VideoDevice *this, SDL_PixelFormat *format, Uint32 flags) @@ -179,7 +180,7 @@ static void omap_InitOSKeymap(SDL_VideoDevice *this) trace(); } -static int event_cb(void *cb_arg, int sdl_kc, int is_pressed) +static int key_event_cb(void *cb_arg, int sdl_kc, int is_pressed) { SDL_keysym keysym = { 0, }; @@ -187,11 +188,24 @@ static int event_cb(void *cb_arg, int sdl_kc, int is_pressed) SDL_PrivateKeyboard(is_pressed, &keysym); } +static int ts_event_cb(void *cb_arg, int x, int y, unsigned int pressure) +{ + static int was_pressed; + + SDL_PrivateMouseMotion(0, 0, x, y); + + pressure = !!pressure; + if (pressure != was_pressed) { + SDL_PrivateMouseButton(pressure ? SDL_PRESSED : SDL_RELEASED, 1, 0, 0); + was_pressed = pressure; + } +} + static void omap_PumpEvents(SDL_VideoDevice *this) { trace(); - omapsdl_input_get_events(0, event_cb, NULL); + omapsdl_input_get_events(0, key_event_cb, ts_event_cb, NULL); } static SDL_VideoDevice *omap_create(int devindex)