aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-11-18 13:36:54 +0100
committerSven Gothel <[email protected]>2013-11-18 13:36:54 +0100
commitead9d65722ac8c647ac1dde654fd4e8250e4d572 (patch)
treedbb4e705d43cec0d63e1a14f8f8f954e52bc73c5 /src/newt/classes/com
parent97c8e627068af729d9ea0f7992b2bc5981655296 (diff)
NewtCanvasAWT: Add method of 'isAWTEventPassThrough()', used in unit tests to fix event validation for offscreen mode (OSX/CALayer)
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r--src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
index f9f869781..5780f2540 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
@@ -735,6 +735,20 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
}
}
+ /**
+ * Returns <code>true</code> if Key and Mouse input events will be passed through AWT,
+ * otherwise only the {@link #getNEWTChild() NEWT child} will receive them.
+ * <p>
+ * Normally only the {@link #getNEWTChild() NEWT child} will receive Key and Mouse input events.
+ * In offscreen mode, e.g. OSX/CALayer, the AWT events will be received and translated into NEWT events
+ * and delivered to the NEWT child window.<br/>
+ * Note: AWT key events will {@link java.awt.event.InputEvent#consume() consumed} in pass-through mode.
+ * </p>
+ */
+ public final boolean isAWTEventPassThrough() {
+ return !isOnscreen;
+ }
+
private final void attachNewtChild() {
if( null == newtChild || null == jawtWindow || newtChildAttached ) {
return; // nop