android: fix touchscreen on Retroid Pocket 2+

Unexpected event source for touchscreen events
This commit is contained in:
Flyinghead 2022-04-15 18:06:15 +02:00
parent fd50529d86
commit db525bd5db
1 changed files with 3 additions and 2 deletions

View File

@ -164,8 +164,9 @@ public class VirtualJoystickDelegate {
public boolean onTouchEvent(MotionEvent event, int width, int height)
{
if (event.getSource() != InputDevice.SOURCE_TOUCHSCREEN)
// Ignore real mice, trackballs, etc.
// The Retroid Pocket 2+ is using a non-standard source
if (event.getSource() != InputDevice.SOURCE_TOUCHSCREEN && event.getSource() != 0x5002)
// Ignore real mice, trackballs, etc.
return false;
JNIdc.show_osd();
this.handler.removeCallbacks(hideOsdRunnable);