Warning: Undefined array key 34 in /mnt/web218/a3/28/510129628/htdocs/xmlhelp.php on line 522 GLBasic User Manual

GLBasic User Manual

Main sections

JOYSTATE

JOYSTATE jx##, jy##, jba##, jbb##



Sets the values of jx## and jy## to the current joystick position. jba## and jbb## represent the states of the buttons A and B. (1=Pushed, 0=Released)
-1 = Left / Up
0 = No Direction
+1 = Right / Down

Sample:
 
// End with ESC
WHILE TRUE // Endless loop
    JOYSTATE jx, jy, ba, bb
a$="JX:" + jx + " JY:" + jy + " ButtonA:" + ba + " ButtonB" +bb
PRINT a$, 10, 100
SHOWSCREEN
WEND

See also...