diff options
Diffstat (limited to 'src/test/com/jogamp/opengl')
-rw-r--r-- | src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java | 16 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java | 8 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java index c0eaec842..592ecf5d6 100644 --- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java +++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java @@ -30,17 +30,22 @@ package com.jogamp.opengl.test.android; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLProfile; +import jogamp.newt.driver.android.AndroidWindow; import jogamp.newt.driver.android.NewtBaseActivity; import com.jogamp.newt.ScreenMode; +import com.jogamp.newt.event.MouseAdapter; +import com.jogamp.newt.event.MouseEvent; import com.jogamp.newt.event.ScreenModeListener; import com.jogamp.newt.opengl.GLWindow; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; import com.jogamp.opengl.util.Animator; +import android.content.Context; import android.os.Bundle; import android.util.Log; +import android.view.inputmethod.InputMethodManager; public class NEWTGearsES2Activity extends NewtBaseActivity { static String TAG = "NEWTGearsES2Activity"; @@ -56,6 +61,17 @@ public class NEWTGearsES2Activity extends NewtBaseActivity { GLWindow glWindow = GLWindow.create(caps); glWindow.setFullscreen(true); setContentView(getWindow(), glWindow); + glWindow.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + if(e.getPressure()>2f) { // show Keyboard + final AndroidWindow win = (AndroidWindow)e.getSource(); + InputMethodManager mgr = (InputMethodManager) win.getAndroidView().getContext().getSystemService(Context.INPUT_METHOD_SERVICE); + mgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); // shows keyboard .. + win.getAndroidView().requestFocus(); + } + } + }); GearsES2 demo = new GearsES2(-1); // demo.enableAndroidTrace(true); diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java index 1a636a1aa..1dfdde515 100644 --- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java +++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java @@ -52,14 +52,14 @@ public class NEWTGearsES2ActivityLauncher extends LauncherUtil.BaseActivityLaunc props.setProperty("jogl.debug.GLDrawable", "true"); props.setProperty("jogl.debug.GLContext", "true"); props.setProperty("jogl.debug.GLSLCode", "true"); - props.setProperty("jogl.debug.CapabilitiesChooser", "true"); + // props.setProperty("jogl.debug.CapabilitiesChooser", "true"); // properties.setProperty("jogl.debug.GLSLState", "true"); // properties.setProperty("jogl.debug.DebugGL", "true"); // properties.setProperty("jogl.debug.TraceGL", "true"); // properties.setProperty("newt.debug", "all"); - props.setProperty("newt.debug.Window", "true"); - // properties.setProperty("newt.debug.Window.MouseEvent", "true"); - // properties.setProperty("newt.debug.Window.KeyEvent", "true"); + // props.setProperty("newt.debug.Window", "true"); + // props.setProperty("newt.debug.Window.MouseEvent", "true"); + // props.setProperty("newt.debug.Window.KeyEvent", "true"); props.setProperty("jogamp.debug.IOUtil", "true"); } |