From eb3f5116a5006d03c9e0f94f797b9dfd9dee3aee Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 24 Mar 2012 15:48:15 -0700 Subject: make mouse events relative to canvas, and at right frequency --- tests/sdl_mouse.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/sdl_mouse.c') diff --git a/tests/sdl_mouse.c b/tests/sdl_mouse.c index 87619ef2..eb731186 100644 --- a/tests/sdl_mouse.c +++ b/tests/sdl_mouse.c @@ -43,6 +43,9 @@ int main() { SDL_Init(SDL_INIT_VIDEO); SDL_Surface *screen = SDL_SetVideoMode(600, 450, 32, SDL_HWSURFACE); + SDL_Rect rect = { 0, 0, 600, 450 }; + SDL_FillRect(screen, &rect, 0x2244ff00); + emscripten_run_script("simulateMouseEvent(10, 20, 0)"); // move from 0,0 to 10,20 emscripten_run_script("simulateMouseEvent(10, 20, 1)"); // click emscripten_run_script("simulateMouseEvent(30, 77, 0)"); // move some more -- cgit v1.2.3-18-g5258