From 66acfa2a164f8bb34802a42d410c7881af67bed8 Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Tue, 4 Feb 2014 20:43:56 +0200 Subject: [PATCH] Moved check to ignore touch events with [0, 0] coordingates from MTK-specific to generic code --- project/java/Video.java | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/project/java/Video.java b/project/java/Video.java index 9daf601a2..dd8791807 100644 --- a/project/java/Video.java +++ b/project/java/Video.java @@ -119,8 +119,6 @@ abstract class DifferentTouchInput return IcsTouchInputWithHistory.Holder.sInstance; if( DetectCrappyDragonRiseDatexGamepad() ) return CrappyDragonRiseDatexGamepadInputWhichNeedsItsOwnHandlerBecauseImTooCheapAndStupidToBuyProperGamepad.Holder.sInstance; - if( android.os.Build.BOARD.contains("bird") ) - return CrappyMtkTabletWithBrokenTouchDrivers.Holder.sInstance; return IcsTouchInput.Holder.sInstance; } if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD ) @@ -361,7 +359,8 @@ abstract class DifferentTouchInput } buttonState = buttonStateNew; } - super.process(event); // Push mouse coordinate first + if( event.getX() != 0.0f || event.getY() != 0.0f ) // Ignore event when it has zero coordinates, this is sent by crappy Mediatek-based tablets + super.process(event); // Push mouse coordinate first } public void processGenericEvent(final MotionEvent event) { @@ -382,7 +381,8 @@ abstract class DifferentTouchInput DemoGLSurfaceView.nativeMouseWheel(scrollX, scrollY); return; } - super.processGenericEvent(event); + if( event.getX() != 0.0f || event.getY() != 0.0f ) // Ignore event when it has zero coordinates, this is sent by crappy Mediatek-based tablets + super.processGenericEvent(event); } } private static class IcsTouchInputWithHistory extends IcsTouchInput @@ -474,23 +474,6 @@ abstract class DifferentTouchInput return false; } } - private static class CrappyMtkTabletWithBrokenTouchDrivers extends IcsTouchInput - { - private static class Holder - { - private static final CrappyMtkTabletWithBrokenTouchDrivers sInstance = new CrappyMtkTabletWithBrokenTouchDrivers(); - } - public void process(final MotionEvent event) - { - if( event.getX() != 0.0f && event.getY() != 0.0f ) // Ignore event when it has zero coordinates - super.process(event); - } - public void processGenericEvent(final MotionEvent event) - { - if( event.getX() != 0.0f && event.getY() != 0.0f ) // Ignore event when it has zero coordinates - super.processGenericEvent(event); - } - } }