QBasic 1.1: STRIG Statement

Syntax

STRIG(n%) ON
STRIG(n%) OFF
STRIG(n%) STOP
ON STRIG(n%) GOSUB line

Description / Parameter(s)

n% A value that specifies a joystick trigger:
 
n% Trigger
0 Lower trigger, joystick A
2 Lower trigger, joystick B
4 Upper trigger, joystick A
6 Upper trigger, joystick B
STRIG(n%) ON Enables joystick event trapping.
STRIG(n%) OFF Disables joystick event trapping.
STRIG(n%) STOP Suspends joystick event trapping. Events are processed once event trapping is enabled by STRIG ON.
line The label or number of the first line of the event-trapping subroutine.

Example

'This example requires a joystick. ON STRIG(0) GOSUB Handler STRIG(0) ON PRINT "Press Esc to exit." DO UNTIL INKEY$ = CHR$(27): LOOP END Handler: PRINT "Joystick trigger is depressed." RETURN