STICK
Returns current information, as an integer, about a joystick
Implemented by: Atari, GWBASIC, MSX, QBasic, VBDOS, FreeBASIC
With variations:
Also written as:
Usage
The joystick interface is far from being a standard among BASIC implementations. In the 8-bit era, there were analog and the Atari-standard joystick. Some machines supported both, most only one, and some just had no BASIC support for joysticks.
In the MS-QuickBASIC family, STICK returns one of the current coordinates of one of the joysticks, according to the given numerical argument:
- 0 - Joystick A horizontal position
- 1 - Joystick A vertical position
- 2 - Joystick B horizontal position
- 3 - Joystick B vertical position
Oddly, for any other argument but 0, a previous call to STICK(0) is required in order to record all joystick coordinates.
Variations
MSX
In MSX BASIC, STICK returns the current state of an Atari-standard joystick or the keyboard cursor keys. The STICK argument tells the device to be scanned:
- 0 - keyboard cursor keys
- 1 - joystick A
- 2 - joystick B
The return value of STICK will be one of:
- 0 - no direction
- 1 - up
- 2 - up-right
- 3 - right
- 4 - down-right
- 5 - down
- 6 - down-left
- 7 - left
- 8 - up-left