SDL: do not move mouse position when toggling text input, it will unfocus the text input field in the game
This commit is contained in:
Submodule project/jni/application/openarena/engine updated: 145388d845...6b5ccdb73e
Submodule project/jni/application/openarena/vm updated: 9c194fb526...12d746c17e
@@ -464,6 +464,12 @@ static void SendMultitouchEvents( int x, int y, int action, int pointerId, int f
|
|||||||
SDL_ANDROID_MainThreadPushJoystickBall(JOY_TOUCHSCREEN, pointerId, x, y);
|
SDL_ANDROID_MainThreadPushJoystickBall(JOY_TOUCHSCREEN, pointerId, x, y);
|
||||||
if( action == MOUSE_UP )
|
if( action == MOUSE_UP )
|
||||||
SDL_ANDROID_MainThreadPushJoystickButton(JOY_TOUCHSCREEN, pointerId, SDL_RELEASED);
|
SDL_ANDROID_MainThreadPushJoystickButton(JOY_TOUCHSCREEN, pointerId, SDL_RELEASED);
|
||||||
|
if( !SDL_ANDROID_isMouseUsed && pointerId == 0 )
|
||||||
|
{
|
||||||
|
// Set mouse coordinates to track the first touch pointer, they are used elsewhere but not updated when mouse events are disabled
|
||||||
|
SDL_ANDROID_currentMouseX = x;
|
||||||
|
SDL_ANDROID_currentMouseY = y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !isMultitouchUsed && !SDL_ANDROID_isMouseUsed && !SDL_ANDROID_isTouchscreenKeyboardUsed )
|
if( !isMultitouchUsed && !SDL_ANDROID_isMouseUsed && !SDL_ANDROID_isTouchscreenKeyboardUsed )
|
||||||
|
|||||||
@@ -281,7 +281,9 @@ void SDL_ANDROID_CallJavaShowScreenKeyboard(const char * oldText, char * outBuf,
|
|||||||
SDL_ANDROID_MainThreadPushMouseButton( SDL_RELEASED, SDL_BUTTON_LEFT );
|
SDL_ANDROID_MainThreadPushMouseButton( SDL_RELEASED, SDL_BUTTON_LEFT );
|
||||||
SDL_ANDROID_MainThreadPushMouseButton( SDL_RELEASED, SDL_BUTTON_RIGHT );
|
SDL_ANDROID_MainThreadPushMouseButton( SDL_RELEASED, SDL_BUTTON_RIGHT );
|
||||||
SDL_ANDROID_MainThreadPushMouseButton( SDL_RELEASED, SDL_BUTTON_MIDDLE );
|
SDL_ANDROID_MainThreadPushMouseButton( SDL_RELEASED, SDL_BUTTON_MIDDLE );
|
||||||
for (i = 0; i < MAX_MULTITOUCH_POINTERS; i++)
|
//__android_log_print(ANDROID_LOG_INFO, "libSDL", "Releasing all touch pointers: mouse at %4d %4d", SDL_ANDROID_currentMouseX, SDL_ANDROID_currentMouseY);
|
||||||
|
JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeMotionEvent) ( NULL, NULL, SDL_ANDROID_currentMouseX, SDL_ANDROID_currentMouseY, MOUSE_UP, 0, 0, 0 );
|
||||||
|
for (i = 1; i < MAX_MULTITOUCH_POINTERS; i++)
|
||||||
{
|
{
|
||||||
JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeMotionEvent) ( NULL, NULL, 0, 0, MOUSE_UP, i, 0, 0 );
|
JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeMotionEvent) ( NULL, NULL, 0, 0, MOUSE_UP, i, 0, 0 );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user