| 1 |
function joystick_process_events() |
| 2 |
{ |
| 3 |
if (argument_count > 0 && argument[0] > 0) |
| 4 |
exit; |
| 5 |
if (joystick_exists(1)) |
| 6 |
{ |
| 7 |
var xaxis = joystick_xpos(1); |
| 8 |
if (xaxis < -0.3) |
| 9 |
event_perform(ev_mouse, 16); |
| 10 |
if (xaxis > 0.3) |
| 11 |
event_perform(ev_mouse, 17); |
| 12 |
var yaxis = joystick_ypos(1); |
| 13 |
if (yaxis < -0.3) |
| 14 |
event_perform(ev_mouse, 18); |
| 15 |
if (yaxis > 0.3) |
| 16 |
event_perform(ev_mouse, 19); |
| 17 |
if (joystick_check_button(1, 0)) |
| 18 |
event_perform(ev_mouse, 21); |
| 19 |
if (joystick_check_button(1, 1)) |
| 20 |
event_perform(ev_mouse, 22); |
| 21 |
if (joystick_check_button(1, 2)) |
| 22 |
event_perform(ev_mouse, 23); |
| 23 |
if (joystick_check_button(1, 3)) |
| 24 |
event_perform(ev_mouse, 24); |
| 25 |
if (joystick_check_button(1, 4)) |
| 26 |
event_perform(ev_mouse, 25); |
| 27 |
if (joystick_check_button(1, 5)) |
| 28 |
event_perform(ev_mouse, 26); |
| 29 |
if (joystick_check_button(1, 6)) |
| 30 |
event_perform(ev_mouse, 27); |
| 31 |
if (joystick_check_button(1, 7)) |
| 32 |
event_perform(ev_mouse, 28); |
| 33 |
} |
| 34 |
if (joystick_exists(2)) |
| 35 |
{ |
| 36 |
var xaxis = joystick_xpos(2); |
| 37 |
if (xaxis < -0.3) |
| 38 |
event_perform(ev_mouse, 16); |
| 39 |
if (xaxis > 0.3) |
| 40 |
event_perform(ev_mouse, 17); |
| 41 |
var yaxis = joystick_ypos(2); |
| 42 |
if (yaxis < -0.3) |
| 43 |
event_perform(ev_mouse, 18); |
| 44 |
if (yaxis > 0.3) |
| 45 |
event_perform(ev_mouse, 19); |
| 46 |
if (joystick_check_button(2, 0)) |
| 47 |
event_perform(ev_mouse, 21); |
| 48 |
if (joystick_check_button(2, 1)) |
| 49 |
event_perform(ev_mouse, 22); |
| 50 |
if (joystick_check_button(2, 2)) |
| 51 |
event_perform(ev_mouse, 23); |
| 52 |
if (joystick_check_button(2, 3)) |
| 53 |
event_perform(ev_mouse, 24); |
| 54 |
if (joystick_check_button(2, 4)) |
| 55 |
event_perform(ev_mouse, 25); |
| 56 |
if (joystick_check_button(2, 5)) |
| 57 |
event_perform(ev_mouse, 26); |
| 58 |
if (joystick_check_button(2, 6)) |
| 59 |
event_perform(ev_mouse, 27); |
| 60 |
if (joystick_check_button(2, 7)) |
| 61 |
event_perform(ev_mouse, 28); |
| 62 |
} |
| 63 |
} |