#1
|
|||
|
|||
Key presses, waitKeyDown
Hi
I have a few questions regarding registration of key presses. I noticed that the frequency of registration of key presses using 'waitKeyDown' function depends on the Windows' Keyboard Property, e.g. if you set the 'Repeat Rate' to 'Slow', this function checks the keyboard slower than 'Fast'. I used the following code to test this. Code:
import viz import viztask viz.go() def Keyinput(): while True: k = yield viztask.waitKeyDown(None) print 'key', k.key, 'was pressed' viztask.schedule(Keyinput())
Very many thanks. Greetings :-) Amir |
#2
|
|||
|
|||
If you want capture all key presses, then simply register a callback for viz.KEYDOWN_EVENT and viz.KEYUP_EVENT.
You can also use the viz.key.isDown() function to manually query whether a specific key is down. Set the immediate parameter to True to query the physical keyboard, instead of using the last known value. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
If statements and button presses | new_horizon | Vizard | 1 | 08-23-2011 03:36 AM |
Multiple Button Presses | new_horizon | Vizard | 1 | 08-19-2011 05:58 AM |
Count the milliseconds until the user presses a button? | Josh | Vizard | 2 | 03-24-2010 09:13 AM |