src/video/nds/SDL_ndsevents.c
branchgsoc2008_nds
changeset 2678 3895761db26a
parent 2676 082cc3ffd7d8
child 2698 e1da92da346c
--- 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: */