on_joy1 ... on_joy2_10
The function is executed when the first joystick button is pressed.
The ON_JOY2 .. ON_JOY10
and ON_JOY2_1 ... ON_JOY2_10
button events can be used in a similar way for the other buttons and the second
joystick. Dependent on the number of the button, the numbers 256 (button 1,
joystick 1) ... 275 (button 10, joystick 2) are passed as parameter to the function.
Example:
var mpos[2];
function store_mouse_pos(button)
{
if (button == 270)
{
mpos[0] = mouse_cursor.x;
mpos[1] = mouse_cursor.y;
}
}
void main() {
...
on_joy2_5 = store_mouse_pos;
...
See also:
on_click, on_mouse_left, on_mouse_stop, on_f1, on_anykey,
► latest
version online