Files
QtGameMaker/help/files/404_03_joystick.html
T

82 lines
2.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>The Joystick</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>The joystick</h3>
There are some events associated with joysticks. But to have full control over
the joysticks there is a whole set of functions to deal with joysticks.
<i>Game Maker</i> supports up to two joysticks. So all of these functions
take a joystick id as argument.
<p>
<blockquote>
<tt><b>joystick_exists(id)</b></tt>
Returns whether joystick id (1 or 2) exists.<br>
<tt><b>joystick_name(id)</b></tt>
Returns the name of the joystick<br>
<tt><b>joystick_axes(id)</b></tt>
Returns the number of axes of the joystick.<br>
<tt><b>joystick_buttons(id)</b></tt>
Returns the number of buttons of the joystick.<br>
<tt><b>joystick_has_pov(id)</b></tt>
Returns whether the joystick has point-of-view capabilities.<br>
<tt><b>joystick_direction(id)</b></tt>
Returns the keycode (vk_numpad1 to vk_numpad9) corresponding to the
direction of joystick id (1 or 2).<br>
<tt><b>joystick_check_button(id,numb)</b></tt>
Returns whether the joystick button is pressed (numb in the range 1-32).<br>
<tt><b>joystick_xpos(id)</b></tt>
Returns the position (-1 to 1) of the x-axis of joystick id.<br>
<tt><b>joystick_ypos(id)</b></tt>
Returns the joysticks y-position.<br>
<tt><b>joystick_zpos(id)</b></tt>
Returns the joysticks z-position (if it has a z-axis).<br>
<tt><b>joystick_rpos(id)</b></tt>
Returns the joysticks rudder position (or fourth axis).<br>
<tt><b>joystick_upos(id)</b></tt>
Returns the joysticks u-position (or fifth axis).<br>
<tt><b>joystick_vpos(id)</b></tt>
Returns the joysticks v-position (or sixth axis).<br>
<tt><b>joystick_pov(id)</b></tt>
Returns the joysticks point-of view position. This is an angle
between 0 and 360 degrees. 0 is forwards, 90 to the right, 180
backwards and 270 to the left. When no point-of-view direction
is pressed by the user -1 is returned.<br>
</blockquote>
<p>
<!--END-->
</body>
</html>
<!-- KEYWORDS
joysticks
joystick functions
joystick buttons
joystick axes
joystick_exists()
joystick_direction()
joystick_name()
joystick_axes()
joystick_buttons()
joystick_has_pov()
joystick_check_button()
joystick_xpos()
joystick_ypos()
joystick_zpos()
joystick_rpos()
joystick_upos()
joystick_vpos()
joystick_pov()
-->