Class MouseController
Object
|
+--Controller
|
+--MouseController
- class
MouseController
- extends Controller
Get mouse button and motion events of the SDL output window. The Mouse Controller holds callbacks to javascript.
Author: MrGoil
Defined in Controller.js
Constructor Summary |
MouseController()
The MouseController constructor creates a controller which receives mousebutton and mousemotion events.
|
Method Summary |
bool callback
|
button(<int> button, <int> state, <int> x, <int> y)
This will be called on mouse button up and down.
|
bool
|
grab(<bool> state)
Grabbing means that the mouse is confined to the application window.
|
bool callback
|
motion(<int> buttonmask, <int> x, <int> y, <int> xrel, <int> yrel)
This will be called when mouse is moving over the viewport.
|
MouseController
MouseController()
The MouseController constructor creates a controller which receives mousebutton and mousemotion events. It dispatches them to .motion() and .button().
button
bool callback button(<int> button, <int> state, <int> x, <int> y)
This will be called on mouse button up and down.
Parameters:
button
- number from 1 up to ...
x
- where in the viewport it happened
Returns:
return true, when event was handled, false to requeue event
grab
bool grab(<bool> state)
Grabbing means that the mouse is confined to the application window.
Hides the Cursor.
Just in case you fuck up with it, the grab will be released when:
- the controller object is deleted
- the controller is removed
- script errors in the callback function
- activate(false)
Parameters:
state
- true to grab the mouse, false to release
Returns:
last state or current state when called w/o parameter
motion
bool callback motion(<int> buttonmask, <int> x, <int> y, <int> xrel, <int> yrel)
This will be called when mouse is moving over the viewport.
If the input is grabbed, then the mouse will give relative motion events even when the cursor reaches the edge fo the screen. This is currently only implemented on Windows and Linux/Unix-a-likes.
Parameters:
buttonmask
- mousebutton bitmap
x
- where in the viewport it happened
xrel
- Relative motion in the X/Y direction
Returns:
return true, when event was handled, false to requeue event
FreeJ scripting documentation is Copyleft (C) 2000 - 2007 dyne.org foundation. Verbatim copying and distribution of this entire page is permitted in any medium, provided this notice is preserved.
Send inquiries & questions to dyne.org's hackers.
Documentation generated by
JSDoc on Thu May 29 20:56:52 2008