SDL: bigger delay for 'tap or timeout' left mouse click, this commit can break emulators like ScummVM

This commit is contained in:
Sergii Pylypenko
2016-04-22 22:27:18 +03:00
parent a6875ff236
commit 1842bb2209
7 changed files with 10 additions and 8 deletions

View File

@@ -127,7 +127,7 @@ ScreenFollowsMouse=
GenerateSubframeTouchEvents=n GenerateSubframeTouchEvents=n
# Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n) # Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n)
ForceRelativeMouseMode=n ForceRelativeMouseMode=y
# Show on-screen dpad/joystick, that will act as arrow keys (y) or (n) # Show on-screen dpad/joystick, that will act as arrow keys (y) or (n)
AppNeedsArrowKeys=y AppNeedsArrowKeys=y

View File

@@ -528,7 +528,7 @@ static void ProcessMouseUp( int x, int y )
SDL_ANDROID_MainThreadPushMouseMotion( mouseInitialX - 1, mouseInitialY ); SDL_ANDROID_MainThreadPushMouseMotion( mouseInitialX - 1, mouseInitialY );
mouseInitialX = -1; mouseInitialX = -1;
mouseInitialY = -1; mouseInitialY = -1;
deferredMouseTap = 1; deferredMouseTap = 10;
mouseClickTimeout = 200; mouseClickTimeout = 200;
if( mouseClickTimeoutInitialized ) if( mouseClickTimeoutInitialized )
sem_post(&mouseClickTimeoutSemaphore); sem_post(&mouseClickTimeoutSemaphore);
@@ -878,7 +878,9 @@ static void ProcessDeferredMouseTap()
{ {
if( deferredMouseTap > 0 ) if( deferredMouseTap > 0 )
{ {
deferredMouseTap = 0; deferredMouseTap--;
if (deferredMouseTap > 0)
return;
SDL_ANDROID_MainThreadPushMouseButton( SDL_RELEASED, SDL_BUTTON_LEFT ); SDL_ANDROID_MainThreadPushMouseButton( SDL_RELEASED, SDL_BUTTON_LEFT );
if( forceScreenUpdateMouseClick && SDL_ANDROID_currentMouseX + 1 < SDL_ANDROID_sFakeWindowWidth ) if( forceScreenUpdateMouseClick && SDL_ANDROID_currentMouseX + 1 < SDL_ANDROID_sFakeWindowWidth )
SDL_ANDROID_MainThreadPushMouseMotion( SDL_ANDROID_currentMouseX + 1, SDL_ANDROID_currentMouseY ); SDL_ANDROID_MainThreadPushMouseMotion( SDL_ANDROID_currentMouseX + 1, SDL_ANDROID_currentMouseY );