From b88fe18cf4eb5028b8f53e62921827b1f2e64f8f Mon Sep 17 00:00:00 2001 From: pelya Date: Wed, 13 Jun 2012 13:27:06 +0300 Subject: [PATCH] Disabled half-assed mouse detection --- project/java/Video.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/project/java/Video.java b/project/java/Video.java index aa813587f..5f9798fa6 100644 --- a/project/java/Video.java +++ b/project/java/Video.java @@ -276,12 +276,14 @@ abstract class DifferentTouchInput } if( (event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_HOVER_MOVE ) // Support bluetooth/USB mouse - available since Android 3.1 { + /* if( !ExternalMouseDetected ) { ExternalMouseDetected = true; Settings.nativeSetExternalMouseDetected(); Toast.makeText(MainActivity.instance, R.string.hardware_mouse_detected, Toast.LENGTH_SHORT).show(); } + */ // TODO: it is possible that multiple pointers return that event, but we're handling only pointer #0 if( touchEvents[0].down ) action = Mouse.SDL_FINGER_UP; @@ -345,15 +347,19 @@ abstract class DifferentTouchInput { if( event.getSource() != InputDevice.SOURCE_TOUCHPAD ) { - if( !ExternalMouseDetected && event.getSource() == InputDevice.SOURCE_MOUSE ) + /* + if( !ExternalMouseDetected && + ( event.getSource() == InputDevice.SOURCE_MOUSE || event.getSource() == InputDevice.SOURCE_STYLUS ) ) { ExternalMouseDetected = true; Settings.nativeSetExternalMouseDetected(); Toast.makeText(MainActivity.instance, R.string.hardware_mouse_detected, Toast.LENGTH_SHORT).show(); } + */ process(event); return; } + int x = (int)((event.getX() - xmin) / xmax * 65535.0f); int y = (int)((event.getY() - ymin) / ymax * 65535.0f); // Use only left square part of a touch surface - I've heard reports that it breaks functionality, feel free to uncomment and test it.