The change to AWTNewtEventFactory appears to fix the original issue for AWTCanvas instances, and the TestNewtEventModifiersAWTCanvas appears to work ok too. However, there are still issues with NewtCanvasAWT and NewtCanvasSWT instances. These might be problems in the test code, but there's also a good chance there are still issues in the NEWT event delivery infrastructure. For the time being I recommend that only TestNewtEventModifiersAWTCanvas be included in routine unit tests.
The tests are defined in TestNewtEventModifiers, and the remaining test classes extend it to define how the window and associated GL drawing surface are created.
File ModifierMappings.txt is simply informational, and shows how the modifier bits are laid out between AWT and NEWT. This possibly should have been a spreadsheet.
AWTNewtEventFactory: - getAWTButtonMask() -> getAWTButtonDownMask() - using proper _DOWN_MASK values (regression of commit 13168c99ff9e8bf71c83f1be7afee270a3db4074) - com.jogamp.newt.event.MouseEvent.BUTTON_NUMBER buttons - adding 'ModifierMappings.txt' to API doc header - remove obsolete 'int awtModifiers2Newt(int awtMods, boolean mouseHint)' - 'int awtButton2Newt(int awtButton)' 1:1 button name mapping
Tests: - rename TestNewtEventModifiers -> BaseNewtEventModifiers to avoid being picked up by our junit testing framework. The latter tests all classes starting w/ 'Test*'
- 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/.
NEWT peserve 'mouseButtonModMask' to be sent for all mouse- and key events. TODO: NEWT Event Factories. Misc: Cleaned up spacing.
On some native OS, the accumulation of pressed button modifier-mask is not available, e.g. OS X.
NEWT WindowImpl.doMouseEvent(..), invoked by native NEWT events, will track the pressed mouse button modifier-mask, similar to mouseButtonPressed to synthesize the DRAGGED event.
Added NEWT WindowImpl.doKeyEvent(..) to honor the pressed mouse button modifier-mask, i.e. pass it w/ key events as well.
TODO: Unify synthesization of NEWT event artifacts as described by the above, allowing NEWT event translation to benefit from same code to gain same semantics. Notable: AWTNewtEventFactory and SWTNewtEventFactory