qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
STRIG Function
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Returns the status of a joystick trigger.
 
STRIG(n%)
 
    ■ n%    A value that specifies a joystick status condition:
 
            n%    Condition
            ══    ════════════════════════════════════════════════════════
            0     Lower joystick A trigger was pressed since last STRIG(0)
            1     Lower joystick A trigger is currently pressed
            2     Lower joystick B trigger was pressed since last STRIG(2)
            3     Lower joystick B trigger is currently pressed
            4     Upper joystick A trigger was pressed since last STRIG(4)
            5     Upper joystick A trigger is currently pressed
            6     Upper joystick B trigger was pressed since last STRIG(6)
            7     Upper joystick B trigger is currently pressed
 
    ■ STRIG returns -1 if the condition is true, 0 otherwise.
 
Example:
    PRINT "Press Esc to exit."
    DO
        IF STRIG(0) OR INKEY$ = CHR$(27) THEN EXIT DO
    LOOP
    DO
        BEEP                  'BEEP while trigger A is pressed.
    LOOP WHILE STRIG(1)
 
See Also    STICK    STRIG, ON STRIG Statements