Mice from the future


#1

 

I have been experimenting with noting the times associated with mouse events and midi events, in order to get very accurate triggering for clips (starting a clip within an audio block).  Naturally this works fine for midi, and for mouse events on mac.

On windows however (Ahhh windows .. you're so cute), the mouseEvents have times that are IN THE FUTURE!!!!!!  Meaning .. the mouse event callback is triggered BEFORE the mouse event actually happens.  Huh??

 

Here, try it yourself:

mouseDown(const MouseEvent &e) {

     double currentTime = Time::getCurrentTime().toMilliseconds();                
     double eventTime = double(e.eventTime.toMilliseconds());                
 
     jassert(currentTime > eventTime); // because ... it already happened

}

 

Maybe I am missing something painfully obvious here ... but that assertion is fine on mac, but fails (by a difference of about 4 ms) on PC.  Anyone know whats going on there?

WINDOWS ... WTF?!