Setting P2D or P3D breaks windows native touch events

Hi, I have used part of the MT4J project, this class in particular, to get Windows 7 and 8 WM_TOUCH touch events. It works perfectly with JAVA2D renderer, but when I use P2D or P3D the native events are not listened anymore. The initialization process works without error, but there are no events, and the mouse events (mousePressed, mouseReleased, mouseDragged) don't work as expected.

I have no clue what's going on, any help would be greatly appreciated. Thanks.

Tagged:

Answers

  • OpenGL is a quite special display mode, perhaps touch events are handled differently, take a look if your library is able to handle this mode.

  • Thanks PhiLho! MT4J is more of a framework, but I am only taking some classes from its source code to handle windows touch events.

    Maybe @codeanticode knows: What are the implications of using P2D or P3D? Is the window registered differently? I believe that it is still a AWT component, and the event listeners are the same, so what changes cause this?

    Thanks!

  • @kosowski both JAVA2D and P2D/P3D register the event listener in the same way, by passing the canvas object to the PApplet.addListeners() method, and setting the PApplet as the listener for the events captured by the canvas.

    Win7 and 8 touch events seem to be supported by JOGL, see this bug thread: https://jogamp.org/bugzilla/show_bug.cgi?id=800, but it only mentions NEWT (which is a new windowing toolkit provided by JOGL) and not AWT... maybe one could ask on the JOGL forum?

  • Thanks a lot codeanticode, would look into it.

Sign In or Register to comment.