From e6987e2452aa8619d4174ac06bb465e36de337c9 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 10 Sep 2025 14:44:26 -0700
Subject: [PATCH] Fixed emulated touch on Android
This also fixes laser pointer input on Meta Quest headsets
(cherry picked from commit 712ce16469a7c251a788e37ac57918eafefa6dc6)
---
src/video/android/SDL_androidtouch.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/video/android/SDL_androidtouch.c b/src/video/android/SDL_androidtouch.c
index 2e1b6026b1457..b93aabcd29aa2 100644
--- a/src/video/android/SDL_androidtouch.c
+++ b/src/video/android/SDL_androidtouch.c
@@ -57,8 +57,8 @@ SDL_TouchID Android_ConvertJavaTouchID(int touchID)
// adb shell input mouse tap 100 100
// adb shell input touchscreen tap 100 100
//
- // Prevent to be -1, since it's used in SDL internal for synthetic events:
- retval -= 1;
+ // Prevent the values -1 and -2, since they're used in SDL internal for synthetic events:
+ retval -= 2;
} else {
// Touch ID 0 is invalid
retval += 1;