add setTimeOut method in inputevent.lua

adapt all the state machine to use setTimeOut. Now supported gestures
includes tap, double tap and hold.
This commit is contained in:
Qingping Hou
2012-11-17 13:41:26 -05:00
parent b7e62491bc
commit d3e0424122
5 changed files with 89 additions and 37 deletions

View File

@@ -299,8 +299,9 @@ static int waitForInput(lua_State *L) {
}
int ticks = SDL_GetTicks();
if (usecs < 0)
if (usecs < 0) {
SDL_WaitEvent(&event);
}
else {
while (SDL_GetTicks()-ticks <= usecs/1000) {
if (SDL_PollEvent(&event)) break;