diff --git a/project/java/Globals.java b/project/java/Globals.java
index 6e8d9fb36..2786be85f 100644
--- a/project/java/Globals.java
+++ b/project/java/Globals.java
@@ -63,6 +63,7 @@ class Globals {
public static final int LEFT_CLICK_NEAR_CURSOR = 1;
public static final int LEFT_CLICK_WITH_MULTITOUCH = 2;
public static final int LEFT_CLICK_WITH_PRESSURE = 3;
+ public static final int LEFT_CLICK_WITH_DPAD = 4;
public static int LeftClickMethod = LEFT_CLICK_NORMAL;
public static final int RIGHT_CLICK_NONE = 0;
public static final int RIGHT_CLICK_WITH_MULTITOUCH = 1;
@@ -70,6 +71,8 @@ class Globals {
public static final int RIGHT_CLICK_WITH_MENU_BUTTON = 3;
public static int RightClickMethod = RIGHT_CLICK_NONE;
public static boolean MoveMouseWithJoystick = false;
+ public static int MoveMouseWithJoystickSpeed = 0;
+ public static int MoveMouseWithJoystickAccel = 0;
public static boolean ClickMouseWithDpad = false;
public static boolean ShowScreenUnderFinger = false;
public static boolean KeepAspectRatio = false;
diff --git a/project/java/Settings.java b/project/java/Settings.java
index 7599caffb..cb044cb44 100644
--- a/project/java/Settings.java
+++ b/project/java/Settings.java
@@ -57,6 +57,8 @@ class Settings
out.writeInt(Globals.ClickScreenPressure);
out.writeInt(Globals.ClickScreenTouchspotSize);
out.writeBoolean(Globals.KeepAspectRatio);
+ out.writeInt(Globals.MoveMouseWithJoystickSpeed);
+ out.writeInt(Globals.MoveMouseWithJoystickAccel);
out.close();
settingsLoaded = true;
@@ -97,6 +99,8 @@ class Settings
Globals.ClickScreenPressure = settingsFile.readInt();
Globals.ClickScreenTouchspotSize = settingsFile.readInt();
Globals.KeepAspectRatio = settingsFile.readBoolean();
+ Globals.MoveMouseWithJoystickSpeed = settingsFile.readInt();
+ Globals.MoveMouseWithJoystickAccel = settingsFile.readInt();
settingsLoaded = true;
@@ -167,6 +171,9 @@ class Settings
if( Globals.AppUsesMouse )
items.add(p.getResources().getString(R.string.leftclick_question));
+
+ if( Globals.MoveMouseWithJoystick )
+ items.add(p.getResources().getString(R.string.pointandclick_joystickmouse));
items.add(p.getResources().getString(R.string.audiobuf_question));
@@ -180,48 +187,65 @@ class Settings
{
MainMenuLastSelected = item;
dialog.dismiss();
+ int selected = 0;
- if( item == 0 )
+ if( item == selected )
showDownloadConfig(p);
+ selected++;
if( Globals.DataDownloadUrl.split("\\^").length <= 1 )
item += 1;
else
- if( item == 1 )
+ if( item == selected )
showOptionalDownloadConfig(p);
+ selected++;
if( item == 2 )
showAdditionalInputConfig(p);
+ selected++;
if( ! Globals.AppNeedsArrowKeys && ! Globals.MoveMouseWithJoystick )
item += 1;
else
- if( item == 3 )
+ if( item == selected )
showKeyboardConfig(p);
+ selected++;
if( ! Globals.UseAccelerometerAsArrowKeys || Globals.AppHandlesJoystickSensitivity )
item += 1;
else
- if( item == 4 )
+ if( item == selected )
showAccelerometerConfig(p);
-
+ selected++;
+
if( ! Globals.UseTouchscreenKeyboard )
item += 1;
else
- if( item == 5 )
+ if( item == selected )
showScreenKeyboardConfig(p);
+ selected++;
if( ! Globals.AppUsesMouse )
item += 1;
else
- if( item == 6 )
+ if( item == selected )
showLeftClickConfig(p);
-
- if( item == 7 )
- showAudioConfig(p);
+ selected++;
- if( item == 8 )
+ if( ! Globals.MoveMouseWithJoystick )
+ item += 1;
+ else
+ if( item == selected )
+ showJoystickMouseConfig(p);
+ selected++;
+
+ if( item == selected )
+ showAudioConfig(p);
+ selected++;
+
+ if( item == selected )
showTouchPressureMeasurementTool(p);
+ selected++;
}
});
AlertDialog alert = builder.create();
@@ -315,7 +339,7 @@ class Settings
p.getResources().getString(R.string.pointandclick_keepaspectratio),
p.getResources().getString(R.string.pointandclick_showcreenunderfinger),
p.getResources().getString(R.string.pointandclick_joystickmouse),
- p.getResources().getString(R.string.leftclick_dpadcenter) };
+ p.getResources().getString(R.string.click_with_dpadcenter) };
boolean defaults[] = {
Globals.UseTouchscreenKeyboard,
@@ -538,7 +562,8 @@ class Settings
final CharSequence[] items = { p.getResources().getString(R.string.leftclick_normal),
p.getResources().getString(R.string.leftclick_near_cursor),
p.getResources().getString(R.string.leftclick_multitouch),
- p.getResources().getString(R.string.leftclick_pressure) };
+ p.getResources().getString(R.string.leftclick_pressure),
+ p.getResources().getString(R.string.leftclick_dpadcenter) };
AlertDialog.Builder builder = new AlertDialog.Builder(p);
builder.setTitle(R.string.leftclick_question);
@@ -648,6 +673,67 @@ class Settings
alert.show();
}
+ static void showJoystickMouseConfig(final MainActivity p)
+ {
+ if( ! Globals.MoveMouseWithJoystick )
+ {
+ Globals.MoveMouseWithJoystickSpeed = 0;
+ showJoystickMouseAccelConfig(p);
+ return;
+ }
+
+ final CharSequence[] items = { p.getResources().getString(R.string.accel_slow),
+ p.getResources().getString(R.string.accel_medium),
+ p.getResources().getString(R.string.accel_fast) };
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(p);
+ builder.setTitle(R.string.pointandclick_joystickmousespeed);
+ builder.setSingleChoiceItems(items, Globals.MoveMouseWithJoystickSpeed, new DialogInterface.OnClickListener()
+ {
+ public void onClick(DialogInterface dialog, int item)
+ {
+ Globals.MoveMouseWithJoystickSpeed = item;
+
+ dialog.dismiss();
+ showJoystickMouseAccelConfig(p);
+ }
+ });
+ AlertDialog alert = builder.create();
+ alert.setOwnerActivity(p);
+ alert.show();
+ }
+
+ static void showJoystickMouseAccelConfig(final MainActivity p)
+ {
+ if( ! Globals.MoveMouseWithJoystick )
+ {
+ Globals.MoveMouseWithJoystickAccel = 0;
+ showConfigMainMenu(p);
+ return;
+ }
+
+ final CharSequence[] items = { p.getResources().getString(R.string.none),
+ p.getResources().getString(R.string.accel_slow),
+ p.getResources().getString(R.string.accel_medium),
+ p.getResources().getString(R.string.accel_fast) };
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(p);
+ builder.setTitle(R.string.pointandclick_joystickmousespeed);
+ builder.setSingleChoiceItems(items, Globals.MoveMouseWithJoystickAccel, new DialogInterface.OnClickListener()
+ {
+ public void onClick(DialogInterface dialog, int item)
+ {
+ Globals.MoveMouseWithJoystickAccel = item;
+
+ dialog.dismiss();
+ showConfigMainMenu(p);
+ }
+ });
+ AlertDialog alert = builder.create();
+ alert.setOwnerActivity(p);
+ alert.show();
+ }
+
static void showTouchPressureMeasurementTool(final MainActivity p)
{
if( Globals.RightClickMethod == Globals.RIGHT_CLICK_WITH_PRESSURE || Globals.LeftClickMethod == Globals.LEFT_CLICK_WITH_PRESSURE )
@@ -727,7 +813,9 @@ class Settings
Globals.MoveMouseWithJoystick ? 1 : 0,
Globals.ClickMouseWithDpad ? 1 : 0,
Globals.ClickScreenPressure,
- Globals.ClickScreenTouchspotSize );
+ Globals.ClickScreenTouchspotSize,
+ Globals.MoveMouseWithJoystickSpeed,
+ Globals.MoveMouseWithJoystickAccel );
if( Globals.AppUsesJoystick && (Globals.UseAccelerometerAsArrowKeys || Globals.UseTouchscreenKeyboard) )
nativeSetJoystickUsed();
if( Globals.AppUsesMultitouch )
@@ -787,7 +875,9 @@ class Settings
private static native void nativeSetTrackballUsed();
private static native void nativeSetTrackballDampening(int value);
private static native void nativeSetAccelerometerSettings(int sensitivity, int centerPos);
- private static native void nativeSetMouseUsed(int RightClickMethod, int ShowScreenUnderFinger, int LeftClickMethod, int MoveMouseWithJoystick, int ClickMouseWithDpad, int MaxForce, int MaxRadius);
+ private static native void nativeSetMouseUsed(int RightClickMethod, int ShowScreenUnderFinger, int LeftClickMethod,
+ int MoveMouseWithJoystick, int ClickMouseWithDpad, int MaxForce, int MaxRadius,
+ int MoveMouseWithJoystickSpeed, int MoveMouseWithJoystickAccel);
private static native void nativeSetJoystickUsed();
private static native void nativeSetMultitouchUsed();
private static native void nativeSetTouchscreenKeyboardUsed();
diff --git a/project/java/translations/values-de/strings.xml b/project/java/translations/values-de/strings.xml
index 0aa9e5af3..f9860ca46 100644
--- a/project/java/translations/values-de/strings.xml
+++ b/project/java/translations/values-de/strings.xml
@@ -75,4 +75,8 @@
Trackball klicken Select-Taste
Bewegen Sie die Maus mit Joystick oder Trackball
Pressure %03d Radius %03d
+Linker Mausklick mit Trackball / Joystick Zentrum
+Bewegen Sie die Maus mit Joystick-Geschwindigkeit
+Bewegen Sie die Maus mit Joystick-Beschleunigung
+Keine
diff --git a/project/java/translations/values-fi/strings.xml b/project/java/translations/values-fi/strings.xml
index 42b20473f..8a27939db 100644
--- a/project/java/translations/values-fi/strings.xml
+++ b/project/java/translations/values-fi/strings.xml
@@ -75,4 +75,8 @@
Trackball Valitse / Select-näppäintä
Siirrä hiiren ohjaimella tai trackball
Paine %03d säde %03d
+Vasen hiiren klikkaus trackball-ohjaimella keskusta
+Siirrä hiiri ohjainta nopeasti
+Siirrä hiiri ohjainta kiihtyvyys
+Ei
diff --git a/project/java/translations/values-fr/strings.xml b/project/java/translations/values-fr/strings.xml
index 3faec7fc3..e78fd0310 100644
--- a/project/java/translations/values-fr/strings.xml
+++ b/project/java/translations/values-fr/strings.xml
@@ -78,4 +78,8 @@
Trackball cliquez / touche de sélection
Déplacez la souris ou un trackball avec joystick
pression %03d rayon %03d
+cliquez gauche de la souris avec trackball centre du joystick /
+Déplacez la souris avec la vitesse joystick
+Déplacez la souris avec une accélération joystick
+Aucun
diff --git a/project/java/translations/values-ru/strings.xml b/project/java/translations/values-ru/strings.xml
index 5f9963a68..2e5b5e8d4 100644
--- a/project/java/translations/values-ru/strings.xml
+++ b/project/java/translations/values-ru/strings.xml
@@ -68,4 +68,8 @@
Нажатие с силой
Нажатие на трекбол / центр джойстика
Перемещение мыши при помощи джойстика или трекбола
+Левый клик мыши при помощи трекбола / центра джойстика
+Перемещение мыши джойстиком - скорость
+Перемещение мыши джойстиком - ускорение
+Нет
diff --git a/project/java/translations/values-uk/strings.xml b/project/java/translations/values-uk/strings.xml
index bb0b055a8..9c03b0210 100644
--- a/project/java/translations/values-uk/strings.xml
+++ b/project/java/translations/values-uk/strings.xml
@@ -68,4 +68,8 @@
>Натиск на екран з силою
Натиск на трекбол / центр джойстику
Переміщення миші за допомогою джойстика або трекбола
+Лівий клік миші за допомогою трекбола / центра джойстика
+Переміщення миші джойстиком - швидкiсть
+Переміщення миші джойстиком - прискорення
+Немає
diff --git a/project/java/translations/values/strings.xml b/project/java/translations/values/strings.xml
index 87c9a897c..cee331b98 100644
--- a/project/java/translations/values/strings.xml
+++ b/project/java/translations/values/strings.xml
@@ -71,11 +71,15 @@
Touch screen with second finger
Touch screen with force
Trackball click / joystick center
+ Left mouse click with trackball / joystick center
Advanced features
Keep 4:3 screen aspect ratio
Show screen under finger in separate window
Move mouse with joystick or trackball
+ Move mouse with joystick speed
+ Move mouse with joystick acceleration
+ None
Please slide finger across the screen for two seconds
Pressure %03d radius %03d
diff --git a/project/jni/application/fheroes2/AndroidAppSettings.cfg b/project/jni/application/fheroes2/AndroidAppSettings.cfg
index 4accfa2f2..ccbd2fa8e 100644
--- a/project/jni/application/fheroes2/AndroidAppSettings.cfg
+++ b/project/jni/application/fheroes2/AndroidAppSettings.cfg
@@ -21,13 +21,13 @@ RedefinedKeys="LCTRL m t h e"
AppTouchscreenKeyboardKeysAmount=0
AppTouchscreenKeyboardKeysAmountAutoFire=0
MultiABI=n
-AppVersionCode=209704
-AppVersionName="2097.04"
+AppVersionCode=211205
+AppVersionName="2112.05"
CompiledLibraries="sdl_net sdl_mixer sdl_image sdl_ttf png intl"
CustomBuildScript=n
-AppCflags='-finline-functions -O2 -DWITH_ZLIB -DWITH_MIXER -DWITH_XML -DWITH_IMAGE -DWITH_TTF -DBUILD_RELEASE'
+AppCflags='-finline-functions -O2 -DWITH_ZLIB -DWITH_MIXER -DWITH_XML -DWITH_IMAGE -DWITH_TTF'
AppLdflags=''
AppSubdirsBuild='fheroes2/src/engine/* fheroes2/src/fheroes2/* fheroes2/src/xmlccwrap/* fheroes2-ai'
AppUseCrystaXToolchain=n
-AppCmdline='fheroes2'
+AppCmdline='fheroes2 -d 500'
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
diff --git a/project/jni/application/src b/project/jni/application/src
index 299033683..59d41f41e 120000
--- a/project/jni/application/src
+++ b/project/jni/application/src
@@ -1 +1 @@
-teeworlds
\ No newline at end of file
+fheroes2
\ No newline at end of file
diff --git a/project/jni/sdl-1.3/src/video/android/SDL_androidinput.c b/project/jni/sdl-1.3/src/video/android/SDL_androidinput.c
index 95ddbd0f8..d176479c4 100644
--- a/project/jni/sdl-1.3/src/video/android/SDL_androidinput.c
+++ b/project/jni/sdl-1.3/src/video/android/SDL_androidinput.c
@@ -57,16 +57,19 @@ static int isTrackballUsed = 0;
static int isMouseUsed = 0;
enum { RIGHT_CLICK_NONE = 0, RIGHT_CLICK_WITH_MULTITOUCH = 1, RIGHT_CLICK_WITH_PRESSURE = 2, RIGHT_CLICK_WITH_MENU_BUTTON = 3 };
-enum { LEFT_CLICK_NORMAL = 0, LEFT_CLICK_NEAR_CURSOR = 1, LEFT_CLICK_WITH_MULTITOUCH = 2, LEFT_CLICK_WITH_PRESSURE = 3 };
+enum { LEFT_CLICK_NORMAL = 0, LEFT_CLICK_NEAR_CURSOR = 1, LEFT_CLICK_WITH_MULTITOUCH = 2, LEFT_CLICK_WITH_PRESSURE = 3, LEFT_CLICK_WITH_DPAD = 4 };
static int leftClickMethod = LEFT_CLICK_NORMAL;
static int rightClickMethod = RIGHT_CLICK_NONE;
int SDL_ANDROID_ShowScreenUnderFinger = 0;
SDL_Rect SDL_ANDROID_ShowScreenUnderFingerRect = {0, 0, 0, 0}, SDL_ANDROID_ShowScreenUnderFingerRectSrc = {0, 0, 0, 0};
static int moveMouseWithArrowKeys = 0;
static int clickMouseWithDpadCenter = 0;
+static int moveMouseWithKbSpeed = 0;
+static int moveMouseWithKbAccel = 0;
static int moveMouseWithKbX = -1, moveMouseWithKbY = -1;
-static int moveMouseWithKbXspeed = 0, moveMouseWithKbYspeed = 0;
-static int moveMouseWithKbUpdateSpeedX = 0, moveMouseWithKbUpdateSpeedY = 0;
+static int moveMouseWithKbSpeedX = 0, moveMouseWithKbSpeedY = 0;
+static int moveMouseWithKbAccelX = 0, moveMouseWithKbAccelY = 0;
+static int moveMouseWithKbAccelUpdateNeeded = 0;
static int maxForce = 0;
static int maxRadius = 0;
int SDL_ANDROID_isJoystickUsed = 0;
@@ -248,8 +251,8 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeMouse) ( JNIEnv* env, jobject thiz, j
}
moveMouseWithKbX = -1;
moveMouseWithKbY = -1;
- moveMouseWithKbXspeed = 0;
- moveMouseWithKbYspeed = 0;
+ moveMouseWithKbSpeedX = 0;
+ moveMouseWithKbSpeedY = 0;
}
if( action == MOUSE_DOWN )
{
@@ -279,24 +282,24 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeMouse) ( JNIEnv* env, jobject thiz, j
if( moveMouseWithKbX >= 0 )
{
if( abs(moveMouseWithKbX - x) > SDL_ANDROID_sFakeWindowWidth / 10 )
- moveMouseWithKbXspeed += moveMouseWithKbX > x ? -1 : 1;
+ moveMouseWithKbSpeedX += moveMouseWithKbX > x ? -1 : 1;
else
- moveMouseWithKbXspeed = moveMouseWithKbXspeed * 2 / 3;
+ moveMouseWithKbSpeedX = moveMouseWithKbSpeedX * 2 / 3;
if( abs(moveMouseWithKbY - y) > SDL_ANDROID_sFakeWindowHeight / 10 )
- moveMouseWithKbYspeed += moveMouseWithKbY > y ? -1 : 1;
+ moveMouseWithKbSpeedY += moveMouseWithKbY > y ? -1 : 1;
else
- moveMouseWithKbYspeed = moveMouseWithKbYspeed * 2 / 3;
+ moveMouseWithKbSpeedY = moveMouseWithKbSpeedY * 2 / 3;
- moveMouseWithKbX += moveMouseWithKbXspeed;
- moveMouseWithKbY += moveMouseWithKbYspeed;
+ moveMouseWithKbX += moveMouseWithKbSpeedX;
+ moveMouseWithKbY += moveMouseWithKbSpeedY;
if( abs(moveMouseWithKbX - x) > SDL_ANDROID_sFakeWindowWidth / 5 ||
abs(moveMouseWithKbY - y) > SDL_ANDROID_sFakeWindowHeight / 5 )
{
moveMouseWithKbX = -1;
moveMouseWithKbY = -1;
- moveMouseWithKbXspeed = 0;
- moveMouseWithKbYspeed = 0;
+ moveMouseWithKbSpeedX = 0;
+ moveMouseWithKbSpeedY = 0;
SDL_ANDROID_MainThreadPushMouseMotion(x, y);
}
else
@@ -364,7 +367,7 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeKey) ( JNIEnv* env, jobject thiz, jint
SDL_ANDROID_MainThreadPushMouseButton( action ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_RIGHT );
return;
}
- if( key == KEYCODE_DPAD_CENTER && clickMouseWithDpadCenter )
+ if( key == KEYCODE_DPAD_CENTER && ( clickMouseWithDpadCenter || leftClickMethod == LEFT_CLICK_WITH_DPAD ) )
{
SDL_ANDROID_MainThreadPushMouseButton( action ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_LEFT );
return;
@@ -424,7 +427,8 @@ JNIEXPORT void JNICALL
JAVA_EXPORT_NAME(Settings_nativeSetMouseUsed) ( JNIEnv* env, jobject thiz,
jint RightClickMethod, jint ShowScreenUnderFinger, jint LeftClickMethod,
jint MoveMouseWithJoystick, jint ClickMouseWithDpad,
- jint MaxForce, jint MaxRadius)
+ jint MaxForce, jint MaxRadius,
+ jint MoveMouseWithJoystickSpeed, jint MoveMouseWithJoystickAccel)
{
isMouseUsed = 1;
rightClickMethod = RightClickMethod;
@@ -434,6 +438,8 @@ JAVA_EXPORT_NAME(Settings_nativeSetMouseUsed) ( JNIEnv* env, jobject thiz,
leftClickMethod = LeftClickMethod;
maxForce = MaxForce;
maxRadius = MaxRadius;
+ moveMouseWithKbSpeed = MoveMouseWithJoystickSpeed + 1;
+ moveMouseWithKbAccel = MoveMouseWithJoystickAccel;
}
JNIEXPORT void JNICALL
@@ -976,50 +982,56 @@ extern void SDL_ANDROID_MainThreadPushKeyboardKey(int pressed, SDL_scancode key)
{
if( key == SDL_KEY(LEFT) )
{
- if( moveMouseWithKbXspeed > 0 )
- moveMouseWithKbXspeed = 0;
- moveMouseWithKbXspeed --;
- moveMouseWithKbUpdateSpeedX = -1;
+ if( moveMouseWithKbSpeedX > 0 )
+ moveMouseWithKbSpeedX = 0;
+ moveMouseWithKbSpeedX -= moveMouseWithKbSpeed;
+ moveMouseWithKbAccelX = -moveMouseWithKbAccel;
+ moveMouseWithKbAccelUpdateNeeded |= 1;
}
else if( key == SDL_KEY(RIGHT) )
{
- if( moveMouseWithKbXspeed < 0 )
- moveMouseWithKbXspeed = 0;
- moveMouseWithKbXspeed ++;
- moveMouseWithKbUpdateSpeedX = 1;
+ if( moveMouseWithKbSpeedX < 0 )
+ moveMouseWithKbSpeedX = 0;
+ moveMouseWithKbSpeedX += moveMouseWithKbSpeed;
+ moveMouseWithKbAccelX = moveMouseWithKbAccel;
+ moveMouseWithKbAccelUpdateNeeded |= 1;
}
if( key == SDL_KEY(UP) )
{
- if( moveMouseWithKbYspeed > 0 )
- moveMouseWithKbYspeed = 0;
- moveMouseWithKbYspeed --;
- moveMouseWithKbUpdateSpeedY = -1;
+ if( moveMouseWithKbSpeedY > 0 )
+ moveMouseWithKbSpeedY = 0;
+ moveMouseWithKbSpeedY -= moveMouseWithKbSpeed;
+ moveMouseWithKbAccelY = -moveMouseWithKbAccel;
+ moveMouseWithKbAccelUpdateNeeded |= 2;
}
else if( key == SDL_KEY(DOWN) )
{
- if( moveMouseWithKbYspeed < 0 )
- moveMouseWithKbYspeed = 0;
- moveMouseWithKbYspeed ++;
- moveMouseWithKbUpdateSpeedY = 1;
+ if( moveMouseWithKbSpeedY < 0 )
+ moveMouseWithKbSpeedY = 0;
+ moveMouseWithKbSpeedY += moveMouseWithKbSpeed;
+ moveMouseWithKbAccelY = moveMouseWithKbAccel;
+ moveMouseWithKbAccelUpdateNeeded |= 2;
}
}
else
{
if( key == SDL_KEY(LEFT) || key == SDL_KEY(RIGHT) )
{
- moveMouseWithKbXspeed = 0;
- moveMouseWithKbUpdateSpeedX = 0;
+ moveMouseWithKbSpeedX = 0;
+ moveMouseWithKbAccelX = 0;
+ moveMouseWithKbAccelUpdateNeeded &= ~1;
}
if( key == SDL_KEY(UP) || key == SDL_KEY(DOWN) )
{
- moveMouseWithKbYspeed = 0;
- moveMouseWithKbUpdateSpeedY = 0;
+ moveMouseWithKbSpeedY = 0;
+ moveMouseWithKbAccelY = 0;
+ moveMouseWithKbAccelUpdateNeeded &= ~2;
}
}
- moveMouseWithKbX += moveMouseWithKbXspeed;
- moveMouseWithKbY += moveMouseWithKbYspeed;
+ moveMouseWithKbX += moveMouseWithKbSpeedX;
+ moveMouseWithKbY += moveMouseWithKbSpeedY;
SDL_mutexV(BufferedEventsMutex);
@@ -1172,7 +1184,7 @@ Uint32 lastMoveMouseWithKeyboardUpdate = 0;
void SDL_ANDROID_processMoveMouseWithKeyboard()
{
- if( moveMouseWithKbUpdateSpeedX == 0 && moveMouseWithKbUpdateSpeedY == 0 )
+ if( ! moveMouseWithKbAccelUpdateNeeded )
return;
Uint32 ticks = SDL_GetTicks();
@@ -1182,11 +1194,11 @@ void SDL_ANDROID_processMoveMouseWithKeyboard()
lastMoveMouseWithKeyboardUpdate = ticks;
- moveMouseWithKbXspeed += moveMouseWithKbUpdateSpeedX;
- moveMouseWithKbYspeed += moveMouseWithKbUpdateSpeedY;
+ moveMouseWithKbSpeedX += moveMouseWithKbAccelX;
+ moveMouseWithKbSpeedY += moveMouseWithKbAccelY;
- moveMouseWithKbX += moveMouseWithKbXspeed;
- moveMouseWithKbY += moveMouseWithKbYspeed;
+ moveMouseWithKbX += moveMouseWithKbSpeedX;
+ moveMouseWithKbY += moveMouseWithKbSpeedY;
SDL_ANDROID_MainThreadPushMouseMotion(moveMouseWithKbX, moveMouseWithKbY);
};