Mercurial > sdl-ios-xcode
diff src/video/nds/SDL_ndsevents.c @ 2678:3895761db26a gsoc2008_nds
Removed old touchscreen system, starting to implement mouse-based touchscreen. Also, more work on a non-software-rendering video driver
author | Darren Alton <dalton@stevens.edu> |
---|---|
date | Thu, 10 Jul 2008 23:35:01 +0000 |
parents | 082cc3ffd7d8 |
children | e1da92da346c |
line wrap: on
line diff
--- a/src/video/nds/SDL_ndsevents.c Wed Jul 02 13:59:30 2008 +0000 +++ b/src/video/nds/SDL_ndsevents.c Thu Jul 10 23:35:01 2008 +0000 @@ -39,6 +39,16 @@ NDS_PumpEvents(_THIS) { scanKeys(); + /* TODO: defer click-age */ + if(keysDown() & KEY_TOUCH) { + SDL_SendMouseButton(0, SDL_PRESSED, 0); + } else if(keysUp() & KEY_TOUCH) { + SDL_SendMouseButton(0, SDL_RELEASED, 0); + } + if(keysHeld() & KEY_TOUCH) { + touchPosition t = touchReadXY(); + SDL_SendMouseMotion(0, 0, t.px, t.py); + } } /* vi: set ts=4 sw=4 expandtab: */