diff options
author | Sven Gothel <[email protected]> | 2013-02-28 15:24:42 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-02-28 15:24:42 +0100 |
commit | b85903ac92be7884e99eb7b85884033d7ea42337 (patch) | |
tree | 3ed60852b1148d9aa1984b6744c15eea5fe7026a /src/test/com/jogamp | |
parent | 01fdd5c564dcb8a7d4f8347f71728f8c2b657cb3 (diff) |
NEWT: Harmonize MouseEvent Pressure (API Change!)
Due to high fluctuation (lack of normalized) pressure values on Android devices,
an option to query the normalized value and access to the current known maximum pressure is required.
MouseEvent:
- getMaxPressure() returning the [self calibrated] known maximum pressure
- getPressure(..) -> getPressure(.., boolean normalize) (API Change!)
- return normalize ? pressure/maxPressure : pressure;
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r-- | src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java | 2 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java index 0c65b6d53..b1ab90a88 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()>0.6f) { + if(e.getPressure(true)>0.8f) { ((com.jogamp.newt.Window) e.getSource()).setKeyboardVisible(true); } } 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 14c6a0cda..99df7c102 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 @@ -367,7 +367,7 @@ public class GearsES2 implements GLEventListener { prevMouseX = e.getX(); prevMouseY = e.getY(); Object src = e.getSource(); - if(e.getPressure()>0.6f && src instanceof Window) { // show Keyboard + if(e.getPressure(true)>0.8f && src instanceof Window) { // show Keyboard ((Window) src).setKeyboardVisible(true); } } |