Skip to content

Commit

Permalink
fix: check if cursorView is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Xtr126 committed Feb 25, 2024
1 parent 7f23fef commit 6fc52d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/xtr/keymapper/server/InputService.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ public IRemoteServiceCallback getCallback() {
}

public void moveCursorX(float x) {
cursorView.setX(x);
if(cursorView != null) cursorView.setX(x);
// To avoid conflict with touch input when moving virtual pointer
if (input.pointerCount < 1) cursorSetX((int) x);
else if (input.pointerCount == 1 && pointerUp) cursorSetX((int) x);
}

public void moveCursorY(float y) {
cursorView.setY(y);
if(cursorView != null) cursorView.setY(y);
// To avoid conflict with touch input when moving virtual pointer
if (input.pointerCount < 1) cursorSetY((int) y);
else if (input.pointerCount == 1 && pointerUp) cursorSetY((int) y);
Expand Down

0 comments on commit 6fc52d0

Please sign in to comment.