Vizard 6 » Command Index » Vizard modules » vizact » <vizact>.whilemousedown
6.3

<vizact>.whilemousedown

Registers a function to handle a mouse button being held down

 

<vizact>.whilemousedown(  
button  
func  
args  
)  

 

button
The mouse button to handle
func
The function to call while the mouse button is down
args
The arguments to pass to the function

Remarks

While the specified mouse button is down the given function will be called

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

#Move the viewpoint forward while the left mouse button is down
vizact.whilemousedown(viz.MOUSEBUTTON_LEFT,viz.move,0,0,0.1)

See also

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