Vizard 7 » Command Index » Vizard modules » vizact » <vizact>.onkeyup
7.6

<vizact>.onkeyup

Registers a function to handle key up events

<vizact>.onkeyup(  
key  
func  
*args  
)  
key
The key to handle
func
The function to call when the key is released
*args
The arguments to pass to the function

Remarks

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

Return Value

A vizact.EventFunction object with the following methods:

Method

Description

<event>.setEnabled(val)

Enable/Disable the event function. The associated function will not be called while the event function is disabled. viz.TOGGLE can be used to toggle the state. Event functions are initially enabled.

<event>.getEnabled()

Get the enabled state of the event function.

<event>.remove()

Permanently unregister the event function.

Example

node = viz.add('ball.wrl')

#Translate the ball up when up arrow released
vizact.onkeyup(viz.KEY_UP,node.setPosition,[0,1,0],viz.REL_PARENT)

See also

<vizact>.onkeychar
<vizact>.onkeydown
<vizact>.whilekeydown