This shows you the differences between two versions of the page.
mgl:functionreferencekeyboardandmouse [2013/05/04 05:35] |
mgl:functionreferencekeyboardandmouse [2013/05/04 05:37] |
||
---|---|---|---|
Line 27: | Line 27: | ||
**purpose:** returns a key down event waitTicks specifies how long to wait for a key press event in seconds. Note that the timing precision is system-dependent: | **purpose:** returns a key down event waitTicks specifies how long to wait for a key press event in seconds. Note that the timing precision is system-dependent: | ||
- | * Mac OS X: nanosecond (gets timestamps using a background thread [[:mgl:functionreferencekeyboardandmouse#mglListener|mglListener]]) | + | * Mac OS X: nanosecond (gets timestamps using a background thread [[:mgl:functionreferencekeyboardandmouse#mglListener:_Background_process_that_reads_mouse_and_keyboard_events|mglListener]]) |
* Linux: 1/HZ s where HZ is the system kernel tick frequency (HZ=100 on older systems, HZ=250 or 500 on more modern systems) | * Linux: 1/HZ s where HZ is the system kernel tick frequency (HZ=100 on older systems, HZ=250 or 500 on more modern systems) | ||
Line 37: | Line 37: | ||
mglOpen | mglOpen | ||
mglGetKeyEvent(0.5) | mglGetKeyEvent(0.5) | ||
+ | |||
===== mglGetMouseEvent: Get a mouse button down event off of queue ===== | ===== mglGetMouseEvent: Get a mouse button down event off of queue ===== | ||
**usage:** mglGetMouseEvent(waitTicks)\\ **purpose:** returns a mouse down event waitTicks specifies how long to wait for a mouse event in seconds. Note that the timing precision is system-dependent: | **usage:** mglGetMouseEvent(waitTicks)\\ **purpose:** returns a mouse down event waitTicks specifies how long to wait for a mouse event in seconds. Note that the timing precision is system-dependent: | ||
- | * Mac OS X: nanosecond (gets timestamp from background thread [[:mgl:functionreferencekeyboardandmouse#mglListener|mglListener]]) | + | * Mac OS X: nanosecond (gets timestamp from background thread [[:mgl:functionreferencekeyboardandmouse#mglListener:_Background_process_that_reads_mouse_and_keyboard_events|mglListener]]) |
* Linux: 1/HZ s where HZ is the system kernel tick frequency (HZ=100 on older systems, HZ=250 or 500 on more modern systems) | * Linux: 1/HZ s where HZ is the system kernel tick frequency (HZ=100 on older systems, HZ=250 or 500 on more modern systems) | ||