Has anyone found a solution to timing of Java Swing mouse events on a Surface Pro or other Microsoft Wacom pen platform?
The goal is to create responsive pen stroke input in a draw type application, including at the start of a stroke.
This problem occurs on a Surface Pro running Windows 8. I observed it previously on a Toshiba TabletPC running XP. On both devices, I believe the pen sensor is Wacom.
The problem is about timing of mousePressed and mouseDragged events. A simple program will have the mousePressed event initiate a stroke, and subsequent mouseDragged events add points to it.
Ostensibly, the mouse and pen should behave similarly in triggering these events.
But in fact I observe that the timing is very different. With the mouse, the mouseDragged event occurs about 8 milliseconds after the mousePressed event. Cool.
With the pen, however, the behavior is weird. When the pen is touched down, a mousePressed event gets triggered promptly. But then there's a significant delay before the first mouseDragged event gets sent. This wrecks the start of pen strokes. Calls to System.currentTimeMillis() returns deceitful answers. These calls say that the mousePressed event and subsequent mouseDragged event occur at the SAME time. This cannot be possible because the event locations are wildly different.
There must be something funny going on between the O/S, Wacom drivers, and Java. Has anyone encountered this, or better yet, a solution?