Vizard 7 » Command Index » Vizard modules » viz » <viz:key>.isDown


This command is used to determine if a key is currently down

key # which key to check
immediate = False  
This can be either an ascii character or a Vizard special key such as viz.KEY_UP
immediate = False
If True, Vizard will immediately query the keyboard instead of using the cached value.


Use this command at any time to see if a key is down.

Return Value

1 if the key is down, 0 if it is not


if viz.key.isDown('a'):
    print('"a" key is down')
if viz.key.isDown(viz.KEY_UP):
    print('Up Arrow is down')

See also