<vizact>.onkeydown

Registers a function to handle key down events

 

<vizact>.onkeydown(
    key    
    func    
    *args    

)

 

key

The key to handle


func

The function to call when the key is pressed


*args

The arguments to pass to the function


Remarks

When the specified key is pressed down, the given function will be called with the passed arguments.

Return Value

None

Example

#Set background color to red when 'r' pressed
vizact.onkeydown('r',viz.clearcolor,viz.RED)