aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2013-03-24 14:07:11 +0100
committerSven Gothel <sgothel@jausoft.com>2013-03-24 14:07:11 +0100
commit21cde04129ea241744b95cad8fd0a545d3474b05 (patch)
tree32f345bdd6ecf15f3854b33b90c354c65d14fc90 /src/test
parentded080fd890c21b54ba1f96d84f9e355711dc88a (diff)
Android/NEWT MouseEvent: Fix Detection/Processing of 2-Finger-Scroll Gesture - Part 2
Multiple tests on different devices disclosed that: - 1 of 2 pointers get disconnected every now and then .. -> Shall tolerate this case - dist-delta within gesture may shrink below doubleTouchSlope -> Remove constraint after gesture detection - Always validate pointer-id GearsES2 - Works quite stable on several devices now - Moved soft-keyboad show to 4-pointer pressed >= 0.7f pressure
Diffstat (limited to 'src/test')
-rw-r--r--src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java2
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java15
3 files changed, 11 insertions, 7 deletions
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
index 6aa2a045e..3e61e509c 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
@@ -54,7 +54,7 @@ public class MovieCubeActivity0 extends NewtBaseActivity {
MouseAdapter showKeyboardMouseListener = new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
- if(e.getPressure(true)>0.8f) {
+ if( e.getPointerCount() == 4 && e.getPressure(true) > 0.7f ) {
((com.jogamp.newt.Window) e.getSource()).setKeyboardVisible(true);
}
}
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java
index 35cf9e7dd..af5b70776 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java
@@ -60,6 +60,7 @@ public class NEWTGearsES2ActivityLauncher extends LauncherUtil.BaseActivityLaunc
props.setProperty("newt.debug.Window", "true");
props.setProperty("newt.debug.Window.MouseEvent", "true");
props.setProperty("newt.debug.Window.KeyEvent", "true");
+ // props.setProperty("newt.debug.Android.MouseEvent", "true");
}
@Override
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
index 06635f2d5..49f1940dc 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
@@ -434,12 +434,15 @@ public class GearsES2 implements GLEventListener {
}
public void mousePressed(MouseEvent e) {
- if( !gesture2PtrZoom.isWithinGesture() && e.getPointerCount()==1 ) {
- prevMouseX = e.getX();
- prevMouseY = e.getY();
- Object src = e.getSource();
- if(e.getPressure(true)>0.8f && src instanceof Window) { // show Keyboard
- ((Window) src).setKeyboardVisible(true);
+ if( !gesture2PtrZoom.isWithinGesture() ) {
+ if( e.getPointerCount()==1 ) {
+ prevMouseX = e.getX();
+ prevMouseY = e.getY();
+ } else if( e.getPointerCount() == 4 ) {
+ final Object src = e.getSource();
+ if( e.getPressure(true) > 0.7f && src instanceof Window) { // show Keyboard
+ ((Window) src).setKeyboardVisible(true);
+ }
}
}
}