Skip to content

Commit

Permalink
fix: Set combined pointer mode automatically for 14 QPR3 and above
Browse files Browse the repository at this point in the history
  • Loading branch information
Xtr126 committed Oct 5, 2024
1 parent cdb7abe commit c5df6b9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
14 changes: 14 additions & 0 deletions app/src/main/java/xtr/keymapper/TouchPointer.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,20 @@ public void switchProfiles() { mHandler.post(() -> {

@Override
public void enablePointer() {
KeymapConfig keymapConfig = requestKeymapConfig();

// Set combined pointer mode automatically for 14 QPR3 and above
if (keymapConfig.pointerMode == KeymapConfig.POINTER_OVERLAY) {
keymapConfig.pointerMode = KeymapConfig.POINTER_COMBINED;
keymapConfig.applySharedPrefs();
activityCallback.stopPointer();
try {
mService.stopServer();
} catch (RemoteException ignored) {
}
return;
}

mHandler.post(() -> {
if(cursorView == null) {
cursorView = CursorBinding.inflate(LayoutInflater.from(
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/xtr/keymapper/server/InputService.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ public InputService(KeymapProfile profile, KeymapConfig keymapConfig, IRemoteSer
// Reduce visibility of system pointer
cursorSetX(0);
cursorSetY(0);
} else if (cursorView == null) {
showCursor();
}
if (currentPointerMode != KeymapConfig.POINTER_SYSTEM) showCursor();

this.touchpadInputMode = keymapConfig.touchpadInputMode;
if (touchpadInputMode == KeymapConfig.TOUCHPAD_DIRECT)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/xtr/keymapper/server/RemoteService.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public void startServer(KeymapProfile profile, KeymapConfig keymapConfig, IRemot
@Override
public void stopServer() {
if (!startedFromShell) {
try {
if (inputService != null) try {
inputService.getCallback().disablePointer();
} catch (RemoteException e) {
throw new RuntimeException(e);
Expand Down

0 comments on commit c5df6b9

Please sign in to comment.