View Single Post
  #2  
Old 10-18-2007, 09:46 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Just register the timer in your keyboard callback:
Code:
def timer1():
    print 'Elapsed time:',viz.elapsed(), 'seconds'

def onkeydown(key):
    if key == ' ':
        quad.add(MovingRoom)
        vizact.ontimer(60,timer1)
Also, in the future please use the [code][/code] tags when posting code snippets. It preserves the indentation, which is necessary for python scripts.
Reply With Quote