Class JoystickController
Object
|
+--Controller
|
+--JoystickController
- class
JoystickController
- extends Controller
The Joystick Controller holds callbacks to javascript.
Assign functions to the callback to handle events:
Example:
jc = new JoystickController();
register_controller(jc);
jc.axismotion = function (which, axis, value) {
echo("joystick axis event: " + which + ", " + axis + ", " + value);
// do something
return true;
}
Defined in Controller.js
Constructor Summary |
JoystickController()
The JoystickController constructor creates a joystick controller
|
Method Summary |
bool
|
axismotion(<int> which, <int> axis, <int> value)
Callback on moving a joystick axis
|
bool
|
ballmotion(<int> which, <int> ball, <int> xrel, <int> yrel)
Callback on trackball motion event
|
bool
|
button(<int> which, <int> button, <int> state)
Callback on button event
|
bool
|
hatmotion(<int> which, <int> hat, <int> value)
Callback on joystick hat position change
|
JoystickController
JoystickController()
The JoystickController constructor creates a joystick controller
axismotion
bool axismotion(<int> which, <int> axis, <int> value)
Callback on moving a joystick axis
Parameters:
which
- Joystick device index
value
- axis position range usually -32767 to 32767
Returns:
true if event is handled otherwise false
ballmotion
bool ballmotion(<int> which, <int> ball, <int> xrel, <int> yrel)
Callback on trackball motion event
Parameters:
which
- The joystick device index
ball
- The joystick trackball index
xrel
- The relative motion in the X direction
yrel
- The relative motion in the Y direction
Returns:
true if event is handled otherwise false
button
bool button(<int> which, <int> button, <int> state)
Parameters:
which
- The joystick device index
button
- The joystick button index
Returns:
true if event is handled otherwise false
hatmotion
bool hatmotion(<int> which, <int> hat, <int> value)
Parameters:
which
- The joystick device index
hat
- The joystick hat index
value
- The hat position value
Returns:
true if event is handled otherwise false
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