diff --git a/demo/sdl2surface_rawfb/main.c b/demo/sdl2surface_rawfb/main.c index a8b661a..5c29f3b 100644 --- a/demo/sdl2surface_rawfb/main.c +++ b/demo/sdl2surface_rawfb/main.c @@ -201,6 +201,11 @@ int main(int argc, char **argv) break; } + + /* We don't want to compress key up/down nor mouse button up/down buttons, + because MacOS generates two events per Trackpad tap, and they could be lost. */ + if((event.type==SDL_MOUSEBUTTONUP)||(event.type==SDL_MOUSEBUTTONDOWN)|| + (event.type==SDL_KEYUP)||(event.type==SDL_KEYDOWN)) break; } nk_input_end(&(context->ctx)); diff --git a/demo/sdl_opengl2/main.c b/demo/sdl_opengl2/main.c index 45c51d2..9ada1b4 100644 --- a/demo/sdl_opengl2/main.c +++ b/demo/sdl_opengl2/main.c @@ -138,6 +138,11 @@ main(int argc, char *argv[]) while (SDL_PollEvent(&evt)) { if (evt.type == SDL_QUIT) goto cleanup; nk_sdl_handle_event(&evt); + + /* We don't want to compress key up/down nor mouse button up/down buttons, + because MacOS generates two events per Trackpad tap, and they could be lost. */ + if((evt.type==SDL_MOUSEBUTTONUP)||(evt.type==SDL_MOUSEBUTTONDOWN)|| + (evt.type==SDL_KEYUP)||(evt.type==SDL_KEYDOWN)) break; } nk_input_end(ctx); diff --git a/demo/sdl_opengl3/main.c b/demo/sdl_opengl3/main.c index e039a2f..0d3c001 100644 --- a/demo/sdl_opengl3/main.c +++ b/demo/sdl_opengl3/main.c @@ -149,6 +149,11 @@ int main(int argc, char *argv[]) while (SDL_PollEvent(&evt)) { if (evt.type == SDL_QUIT) goto cleanup; nk_sdl_handle_event(&evt); + + /* We don't want to compress key up/down nor mouse button up/down buttons, + because MacOS generates two events per Trackpad tap, and they could be lost. */ + if((evt.type==SDL_MOUSEBUTTONUP)||(evt.type==SDL_MOUSEBUTTONDOWN)|| + (evt.type==SDL_KEYUP)||(evt.type==SDL_KEYDOWN)) break; } nk_input_end(ctx); /* GUI */ diff --git a/demo/sdl_renderer/main.c b/demo/sdl_renderer/main.c index 940ea84..8ae29b0 100644 --- a/demo/sdl_renderer/main.c +++ b/demo/sdl_renderer/main.c @@ -176,6 +176,11 @@ main(int argc, char *argv[]) while (SDL_PollEvent(&evt)) { if (evt.type == SDL_QUIT) goto cleanup; nk_sdl_handle_event(&evt); + + /* We don't want to compress key up/down nor mouse button up/down buttons, + because MacOS generates two events per Trackpad tap, and they could be lost. */ + if((evt.type==SDL_MOUSEBUTTONUP)||(evt.type==SDL_MOUSEBUTTONDOWN)|| + (evt.type==SDL_KEYUP)||(evt.type==SDL_KEYDOWN)) break; } nk_input_end(ctx);