mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 22:36:00 +00:00
Fix controller rings on linked data dirs, route rumble to the controller, capture the mouse for pointer locks (#242)
- #166: export the fake-input ring paths with the spelling the session tree is bound under (Context.getFilesDir(), /data/user/0/...) instead of the canonical path. Where /data/user/0 resolves to /data/data (ColorOS 16) the guest has nothing bound at the canonical prefix, so libfakeinput could not open the rings and every pad, physical and on-screen, was dead. The ring path logic moves to FakeInputRingPaths so it can be unit-tested without the native library. - #219: play a game's rumble on the physical controller that last drove the pad, when Android exposes its motors (strong and weak separately on Android 12+), and fall back to the device's vibrator for the on-screen pad or a controller without rumble. PadBridge records the active controller; the on-screen pad taking over moves rumble back to the phone. - #153: when a program takes a pointer lock (a mouse-look game through gamescope), capture a physical mouse and send its raw deltas as relative motion, so the camera no longer stops where Android's pointer meets the screen edge. Capture is released for the drawer, the PC keyboard, picture in picture, focus loss and pause, and when the lock ends.
This commit is contained in:
1 parent
eaa4a7a047
commit
472bb28c88
8 files changed
+383
-50
No files matched your search
@@ -115,6 +115,11 @@ public final class WaylandCompositor {
|
||||
|
||||
public static void setPointerLockListener(PointerLockListener l) { pointerLockListener = l; }
|
||||
|
||||
/** Unhooks {@code l} only if it is still the listener, so a finishing activity never unhooks its successor's. */
|
||||
public static void clearPointerLockListener(PointerLockListener l) {
|
||||
if (pointerLockListener == l) pointerLockListener = null;
|
||||
}
|
||||
|
||||
/** Invoked from native (droiddeck_on_pointer_lock). */
|
||||
@SuppressWarnings("unused")
|
||||
static void onPointerLock(boolean locked, int x, int y) {
|
||||
@@ -500,4 +505,11 @@ public final class WaylandCompositor {
|
||||
if (dx == 0 && dy == 0) return;
|
||||
nativeSendSceneInput(6, dx * 256, dy * 256);
|
||||
}
|
||||
|
||||
/** As {@link #sendPointerDelta(int, int)}, keeping a captured mouse's fractions of a pixel. */
|
||||
public static void sendPointerDelta(float dx, float dy) {
|
||||
int x = Math.round(dx * 256f), y = Math.round(dy * 256f);
|
||||
if (x == 0 && y == 0) return;
|
||||
nativeSendSceneInput(6, x, y);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user