[Qt-interest] duration of a keypress?

Chris G cgrebeld at gmail.com
Sun Dec 6 17:18:24 CET 2009


>When the gui isn't blocked by long-running functions, starting a timer in
>mousePressEvent and stopping it in mouseReleaseEvent should be pretty
>accurate.

I wish I could do that.  Unfortunately the sometimes-long operations _must_ run
in the main thread, and I actually have no control over how they do
what they do.

The keypress duration is the way the user indicates they want to then
do A instead of B
after the blocking operation, so keypress of 300ms for example would
indicate A and
anything longer is B.

On Mac, I notice that NSEvent has a 'timestamp' method, and Xlib
XKeyEvent structs
have a 'time' field, is there any way to get at that data?



More information about the Qt-interest-old mailing list