diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-05-05 20:13:27 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-05-05 20:13:27 -0700 |
commit | 747ab04f3992b120d279b9e2cbe9f6b507afd86c (patch) | |
tree | 7d5dff53f43eda790de804ea967158d1ac99ced7 /tests/sdl_mouse.c | |
parent | 3de35bb24b392c85e0c2bc646d1150048fa336ec (diff) |
make sdl event handling work in closure, and add testing
Diffstat (limited to 'tests/sdl_mouse.c')
-rw-r--r-- | tests/sdl_mouse.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/sdl_mouse.c b/tests/sdl_mouse.c index 7fc14638..eb4aa425 100644 --- a/tests/sdl_mouse.c +++ b/tests/sdl_mouse.c @@ -49,11 +49,11 @@ int main() { SDL_Rect rect = { 0, 0, 600, 450 }; SDL_FillRect(screen, &rect, 0x2244ffff); - emscripten_run_script("simulateMouseEvent(10, 20, -1)"); // move from 0,0 to 10,20 - emscripten_run_script("simulateMouseEvent(10, 20, 0)"); // click - emscripten_run_script("simulateMouseEvent(10, 20, 0)"); // click some more, but this one should be ignored through PeepEvent - emscripten_run_script("simulateMouseEvent(30, 77, -1)"); // move some more - emscripten_run_script("simulateMouseEvent(30, 77, 1)"); // trigger the end + emscripten_run_script("window.simulateMouseEvent(10, 20, -1)"); // move from 0,0 to 10,20 + emscripten_run_script("window.simulateMouseEvent(10, 20, 0)"); // click + emscripten_run_script("window.simulateMouseEvent(10, 20, 0)"); // click some more, but this one should be ignored through PeepEvent + emscripten_run_script("window.simulateMouseEvent(30, 77, -1)"); // move some more + emscripten_run_script("window.simulateMouseEvent(30, 77, 1)"); // trigger the end emscripten_set_main_loop(one, 0); |