mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-09 16:45:37 -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
|
||||
app_pojavlauncher/src/main/assets/components/jre
|
||||
app_pojavlauncher/src/main/assets/components/lwjgl3/version
|
||||
local.properties
|
||||
.idea/
|
||||
.DS_Store
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package net.kdt.pojavlaunch;
|
||||
|
||||
import static net.kdt.pojavlaunch.MainActivity.fullyExit;
|
||||
import static net.kdt.pojavlaunch.Tools.currentDisplayMetrics;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ClipboardManager;
|
||||
|
|
@ -101,11 +102,13 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
|||
// interested in events where the touch position changed.
|
||||
// int index = event.getActionIndex();
|
||||
int action = event.getActionMasked();
|
||||
float mouseSpeed = LauncherPreferences.PREF_MOUSESPEED;
|
||||
|
||||
float x = event.getX();
|
||||
float y = event.getY();
|
||||
float mouseX, mouseY;
|
||||
|
||||
// Scale the mouse speed
|
||||
mouseX = mMousePointerImageView.getX();
|
||||
mouseY = mMousePointerImageView.getY();
|
||||
|
||||
|
|
@ -117,8 +120,8 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
|||
}
|
||||
} else {
|
||||
if (action == MotionEvent.ACTION_MOVE) { // 2
|
||||
mouseX = Math.max(0, Math.min(CallbackBridge.physicalWidth, mouseX + x - prevX));
|
||||
mouseY = Math.max(0, Math.min(CallbackBridge.physicalHeight, mouseY + y - prevY));
|
||||
mouseX = Math.max(0, Math.min(currentDisplayMetrics.widthPixels, mouseX + (x - prevX) * LauncherPreferences.PREF_MOUSESPEED));
|
||||
mouseY = Math.max(0, Math.min(currentDisplayMetrics.heightPixels, mouseY + (y - prevY) * LauncherPreferences.PREF_MOUSESPEED));
|
||||
placeMouseAt(mouseX, mouseY);
|
||||
sendScaledMousePosition(mouseX, mouseY);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue