Difference between revisions of "STICK"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
imported>Clippy
Line 14: Line 14:
  
  
'''Note: Joysticks MUST not be digital! Only resistance types can be read in Basic.'''
+
'''Note: Only resistance type joysticks can be read by STRIG. Digital ones cannot be read!'''
  
  

Revision as of 22:56, 19 September 2009

The STICK function returns the directional coordinate move of a game port (&H201) joystick.


Syntax: coordinate% = STICK(function%)


  • Function values are only 0 to 3 for 2 joysticks.
  • Returns coordinate values from 1 to 200.
  • STICK(0) is required to get values from the other STICK functions. So use it first always!
  • STICK(0) returns the column coordinate of joystick A. Enables reads of the other STICK values.
  • STICK(1) returns row column coordinate of joystick A.
  • STICK(2) returns column coordinate of joystick B. (second joystick if used)
  • STICK(3) returns row coordinate of joystick B if used.


Note: Only resistance type joysticks can be read by STRIG. Digital ones cannot be read!


See also: STRIG


Navigation:

Go to Keyword Reference - Alphabetical

Go to Keyword Reference - By usage