Vizard 7 » Command Index » Vizard modules » viz » <viz>.getInputTime
7.6

<viz>.getInputTime

Return time of last input event

<viz>.getInputTime()  

Remarks

Return the time of last input event, such as a key press or mouse movement. The time is based from the <viz>.tick command.

Return Value

Time of last input event

Example

import viz
viz.go()

def onkeydown(key):
    elapsed = viz.tick() - viz.getInputTime()
    print('Key was pressed',elapsed,'seconds ago')
viz.callback(viz.KEYDOWN_EVENT,onkeydown)