![]() |
|
#2
|
|||
|
|||
|
You can have a data object returned with waitKeyDown that will contain the key that was pressed and the time it occurred. You can then do your if statement based on that keypress data.
Code:
import viz viz.go() import viztask def MyTask(): d = viz.Data() while True: yield viztask.waitKeyDown(['y','n'],d) print 'Key '+d.key+' was pressed' viztask.schedule( MyTask() ) |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| window.pick function over sub-window | omidbrb | Vizard | 4 | 10-02-2009 05:23 AM |
| Documentating function names | aaThomas | Vizard | 5 | 05-15-2007 10:50 AM |
| Do you know how to send a value for 'pool' to the onActionEnd function? | ghazanfar | Vizard | 1 | 03-22-2007 11:25 AM |
| timers and director function | Jerry | Vizard | 1 | 06-22-2006 10:47 AM |
| node3d.center function | tavaksai | Vizard | 3 | 08-13-2004 12:05 PM |