Difference between revisions of "STRIG"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
m
Line 2: Line 2:




''Syntax:'' IF STRIG(button%) THEN code
{{PageSyntax}}
:: IF STRIG(button%) THEN code




Line 22: Line 23:


''See also:''  
''See also:''  
* [[STRIG (statements)]]
* [[STRIG (statements)]]
* [[ON STRIG(n)]], [[STICK]]
* [[ON STRIG(n)]], [[STICK]]




{{PageNavigation}}
{{PageNavigation}}

Revision as of 03:16, 10 May 2011

The STRIG function returns button presses on game port (&H201) joystick(s).


Syntax

IF STRIG(button%) THEN code


Description:

  • Currently NOT supported in QB64!
  • Button values used range from 0 to 7 only. Use joystick A values for just one joystick.
  • Returns True(-1) or False(0) button press values for 2 joysticks:
  • STRIG(0) = -1 lower button 1 on joystick A pressed since last STRIG(0)
  • STRIG(1) = -1 lower button 1 on joystick A currently pressed
  • STRIG(2) = -1 lower button 1 on joystick B pressed since last STRIG(2)
  • STRIG(3) = -1 lower button 1 on joystick B currently pressed
  • STRIG(4) = -1 upper button 2 on joystick A pressed since last STRIG(4)
  • STRIG(5) = -1 upper button 2 on joystick A currently pressed
  • STRIG(6) = -1 upper button 2 on joystick B pressed since last STRIG(6)"
  • STRIG(7) = -1 upper button 2 on joystick B currently pressed
  • STRIG(0), STRIG(2), STRIG(4) and STRIG(6) are used to monitor any presses that might have been missed.

Note: Only resistance type joysticks can be read by STICK. Digital types cannot be read!


See also:



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page