diff options
Diffstat (limited to 'src/newt/classes/jogamp')
3 files changed, 32 insertions, 6 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index b5cd3e5fd..637f36594 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -45,6 +45,7 @@ import com.jogamp.newt.Window; import com.jogamp.common.util.locks.LockFactory; import com.jogamp.common.util.locks.RecursiveLock; import com.jogamp.newt.ScreenMode; +import com.jogamp.newt.event.InputEvent; import com.jogamp.newt.event.KeyEvent; import com.jogamp.newt.event.KeyListener; import com.jogamp.newt.event.MouseEvent; @@ -1897,6 +1898,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer MouseEvent eClicked = null; MouseEvent e = null; + if(isPointerConfined()) { + modifiers |= InputEvent.CONFINED_MASK; + } + if(!isPointerVisible()) { + modifiers |= InputEvent.INVISIBLE_MASK; + } + if(MouseEvent.EVENT_MOUSE_PRESSED==eventType) { if(when-lastMousePressed<MouseEvent.getClickTimeout()) { lastMouseClickCount++; diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java index b9c8d2c7b..d64cc9359 100644 --- a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java +++ b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java @@ -29,6 +29,7 @@ package jogamp.newt.awt.event; import com.jogamp.common.util.IntIntHashMap; +import com.jogamp.newt.event.InputEvent; public class AWTNewtEventFactory { @@ -122,10 +123,19 @@ public class AWTNewtEventFactory { rotation = ((java.awt.event.MouseWheelEvent)event).getWheelRotation(); } + int mods = awtModifiers2Newt(event.getModifiers(), true); + if(null!=newtSource) { + if(newtSource.isPointerConfined()) { + mods |= InputEvent.CONFINED_MASK; + } + if(!newtSource.isPointerVisible()) { + mods |= InputEvent.INVISIBLE_MASK; + } + } + return new com.jogamp.newt.event.MouseEvent( type, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, event.getWhen(), - awtModifiers2Newt(event.getModifiers(), true), - event.getX(), event.getY(), event.getClickCount(), + mods, event.getX(), event.getY(), event.getClickCount(), awtButton2Newt(event.getButton()), rotation); } return null; // no mapping .. diff --git a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java index ecf1f72cd..863bfd372 100644 --- a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java +++ b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java @@ -32,6 +32,7 @@ import java.awt.event.MouseEvent; import com.jogamp.common.util.IntIntHashMap; import com.jogamp.newt.Window; +import com.jogamp.newt.event.InputEvent; public class AndroidNewtEventFactory { @@ -157,14 +158,22 @@ public class AndroidNewtEventFactory { index++; } + if(null!=newtSource) { + if(newtSource.isPointerConfined()) { + modifiers |= InputEvent.CONFINED_MASK; + } + if(!newtSource.isPointerVisible()) { + modifiers |= InputEvent.INVISIBLE_MASK; + } + } + com.jogamp.newt.event.MouseEvent res[]; com.jogamp.newt.event.MouseEvent me1 = new com.jogamp.newt.event.MouseEvent( type, (null==newtSource)?null:(Object)newtSource, event.getEventTime(), - modifiers , - x, y, pressure, pointers, clickCount, + modifiers, x, y, pressure, pointers, clickCount, pointers.length==1 ? MouseEvent.BUTTON1 : 0, rotation); if(type == com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_RELEASED) { @@ -172,8 +181,7 @@ public class AndroidNewtEventFactory { new com.jogamp.newt.event.MouseEvent( com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_CLICKED, (null==newtSource)?null:(Object)newtSource, event.getEventTime(), - modifiers , - x, y, pressure, pointers, clickCount, + modifiers, x, y, pressure, pointers, clickCount, pointers.length==1 ? MouseEvent.BUTTON1 : 0, rotation); res = new com.jogamp.newt.event.MouseEvent[2]; res[0] = me1; |