summaryrefslogtreecommitdiffstats
path: root/src/newt/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-12-24 01:55:55 +0100
committerSven Gothel <[email protected]>2012-12-24 01:55:55 +0100
commitf3e2467decf2a5ee47cfb458f7071772f39ea9c6 (patch)
tree0830921491346c0449b8ad0800fdeedb14ae2ece /src/newt/classes
parent58eb9d922c2a16a2724aaa2188c56784d440fb99 (diff)
AWT-NEWT Modifier mapping and test: part-3 (NEWT BUTTON MASK always, ..)
- AWTNewtEventFactory's awtModifiers2Newt: - always include NEWT BUTTON_MASK (press, release, ..) where AWT doesn't include them at release (it's only a DOWN_MASK). - Test BaseNewtEventModifiers, .. - No need to call super class Before, BeforeClass, .. manually - Use RedSquareES2 as GL demo - Adapt to AWTNewtEventFactory's modifier change above (NEWT BUTTON MASK even at release) - More descriptive error/log text - Added _mandatory_ TestNewtEventModifiersNEWTWindowAWT to test native NEWT behavior. This shall be the golden behavior all translated events shall compare w/.
Diffstat (limited to 'src/newt/classes')
-rw-r--r--src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
index 665b7b5ee..1a61d0528 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
@@ -194,11 +194,8 @@ public class AWTNewtEventFactory {
* @param awtModsEx
* The AWT extended event modifiers.
* AWT passes mouse button specific bits here and are the preferred way check the mouse button state.
- *
- * @param mouseHint
- * Not used currently.
*/
- public static final int awtModifiers2Newt(final int awtMods, final int awtModsEx, final boolean mouseHint) {
+ public static final int awtModifiers2Newt(final int awtMods, final int awtModsEx) {
int newtMods = 0;
/** Redundant old modifiers ..
@@ -271,7 +268,9 @@ public class AWTNewtEventFactory {
rotation = -1 * ((java.awt.event.MouseWheelEvent)event).getWheelRotation();
}
- int mods = awtModifiers2Newt(event.getModifiers(), event.getModifiersEx(), true);
+ final int newtButton = awtButton2Newt(event.getButton());
+ int mods = awtModifiers2Newt(event.getModifiers(), event.getModifiersEx());
+ mods |= com.jogamp.newt.event.InputEvent.getButtonMask(newtButton); // always include NEWT BUTTON_MASK
if(null!=newtSource) {
if(newtSource.isPointerConfined()) {
mods |= com.jogamp.newt.event.InputEvent.CONFINED_MASK;
@@ -280,11 +279,10 @@ public class AWTNewtEventFactory {
mods |= com.jogamp.newt.event.InputEvent.INVISIBLE_MASK;
}
}
-
return new com.jogamp.newt.event.MouseEvent(
type, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, event.getWhen(),
mods, event.getX(), event.getY(), event.getClickCount(),
- awtButton2Newt(event.getButton()), rotation);
+ newtButton, rotation);
}
return null; // no mapping ..
}
@@ -294,7 +292,7 @@ public class AWTNewtEventFactory {
if(0xFFFFFFFF != type) {
return new com.jogamp.newt.event.KeyEvent(
type, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, event.getWhen(),
- awtModifiers2Newt(event.getModifiers(), event.getModifiersEx(), false),
+ awtModifiers2Newt(event.getModifiers(), event.getModifiersEx()),
event.getKeyCode(), event.getKeyChar());
}
return null; // no mapping ..