summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r--src/newt/classes/com/jogamp/newt/Window.java34
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java19
2 files changed, 53 insertions, 0 deletions
diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java
index 24555bf39..a69b8dbb3 100644
--- a/src/newt/classes/com/jogamp/newt/Window.java
+++ b/src/newt/classes/com/jogamp/newt/Window.java
@@ -225,6 +225,40 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
String getTitle();
+ boolean isPointerVisible();
+
+ /**
+ * Makes the pointer visible or invisible.
+ *
+ * @param pointerVisible defaults to <code>true</code> for platforms w/ visible pointer,
+ * otherwise defaults to <code>true</code>, eg. Android.
+ * @see #confinePointer(boolean)
+ */
+ void setPointerVisible(boolean pointerVisible);
+
+ boolean isPointerConfined();
+
+ /**
+ * Confine the pointer to this window, ie. pointer jail.
+ * <p>
+ * In combination w/ {@link #warpPointer(int, int)}
+ * and maybe {@link #setPointerVisible(boolean)} a simple mouse
+ * navigation can be realized.</p>
+ *
+ * @param confine defaults to <code>false</code>.
+ */
+ void confinePointer(boolean confine);
+
+ /**
+ * Moves the pointer to x/y relative to this window's origin.
+ *
+ * @param x relative pointer x position within this window
+ * @param y relative pointer y position within this window
+ *
+ * @see #confinePointer(boolean)
+ */
+ void warpPointer(int x, int y);
+
/** Defining ids for the reparenting strategy */
public interface ReparentAction {
/** No native reparenting valid */
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index 3a49c06f0..5001e55e5 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -215,10 +215,29 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC
return window.getTitle();
}
+ public final boolean isPointerVisible() {
+ return window.isPointerVisible();
+ }
+
+ public final void setPointerVisible(boolean mouseVisible) {
+ window.setPointerVisible(mouseVisible);
+ }
+
+ public final boolean isPointerConfined() {
+ return window.isPointerConfined();
+ }
+
+ public final void confinePointer(boolean grab) {
+ window.confinePointer(grab);
+ }
+
public final void setUndecorated(boolean value) {
window.setUndecorated(value);
}
+ public final void warpPointer(int x, int y) {
+ window.warpPointer(x, y);
+ }
public final boolean isUndecorated() {
return window.isUndecorated();
}