mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-21 09:01:56 -07:00
SD mode respect mouse speed preferences
This commit is contained in:
parent
793d2e4ba1
commit
aed8217b81
2 changed files with 6 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -2,6 +2,7 @@
|
||||||
/build
|
/build
|
||||||
/*/build
|
/*/build
|
||||||
app_pojavlauncher/src/main/assets/components/jre
|
app_pojavlauncher/src/main/assets/components/jre
|
||||||
|
app_pojavlauncher/src/main/assets/components/lwjgl3/version
|
||||||
local.properties
|
local.properties
|
||||||
.idea/
|
.idea/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package net.kdt.pojavlaunch;
|
package net.kdt.pojavlaunch;
|
||||||
|
|
||||||
import static net.kdt.pojavlaunch.MainActivity.fullyExit;
|
import static net.kdt.pojavlaunch.MainActivity.fullyExit;
|
||||||
|
import static net.kdt.pojavlaunch.Tools.currentDisplayMetrics;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
|
|
@ -101,11 +102,13 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
// interested in events where the touch position changed.
|
// interested in events where the touch position changed.
|
||||||
// int index = event.getActionIndex();
|
// int index = event.getActionIndex();
|
||||||
int action = event.getActionMasked();
|
int action = event.getActionMasked();
|
||||||
|
float mouseSpeed = LauncherPreferences.PREF_MOUSESPEED;
|
||||||
|
|
||||||
float x = event.getX();
|
float x = event.getX();
|
||||||
float y = event.getY();
|
float y = event.getY();
|
||||||
float mouseX, mouseY;
|
float mouseX, mouseY;
|
||||||
|
|
||||||
|
// Scale the mouse speed
|
||||||
mouseX = mMousePointerImageView.getX();
|
mouseX = mMousePointerImageView.getX();
|
||||||
mouseY = mMousePointerImageView.getY();
|
mouseY = mMousePointerImageView.getY();
|
||||||
|
|
||||||
|
|
@ -117,8 +120,8 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (action == MotionEvent.ACTION_MOVE) { // 2
|
if (action == MotionEvent.ACTION_MOVE) { // 2
|
||||||
mouseX = Math.max(0, Math.min(CallbackBridge.physicalWidth, mouseX + x - prevX));
|
mouseX = Math.max(0, Math.min(currentDisplayMetrics.widthPixels, mouseX + (x - prevX) * LauncherPreferences.PREF_MOUSESPEED));
|
||||||
mouseY = Math.max(0, Math.min(CallbackBridge.physicalHeight, mouseY + y - prevY));
|
mouseY = Math.max(0, Math.min(currentDisplayMetrics.heightPixels, mouseY + (y - prevY) * LauncherPreferences.PREF_MOUSESPEED));
|
||||||
placeMouseAt(mouseX, mouseY);
|
placeMouseAt(mouseX, mouseY);
|
||||||
sendScaledMousePosition(mouseX, mouseY);
|
sendScaledMousePosition(mouseX, mouseY);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue