Vizard 8 » Command Index » Vizard modules » vizact » <vizact>.onmouseup
8.0

<vizact>.onmouseup

Registers a function to handle mouse up events

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

Remarks

This command will call the given function when the specified mouse button is released.

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

#Change background color when middle mouse button released
colors = vizact.choice([viz.RED,viz.WHITE,viz.BLUE])
vizact.onmouseup(viz.MOUSEBUTTON_MIDDLE,viz.clearcolor,colors)

See also

<vizact>.onmousedown
<vizact>.onpick
<vizact>.onwheeldown
<vizact>.onwheelup
<vizact>.whilemousedown