STRIG(n): Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 31: | Line 31: | ||
a$ = "[STRIG 0 EVENT]" | a$ = "[STRIG 0 EVENT]" | ||
{{Cl|FOR...NEXT|FOR}} x = 1 {{Cl|TO}} {{Cl|LEN}}(a$) | {{Cl|FOR...NEXT|FOR}} x = 1 {{Cl|TO}} {{Cl|LEN}}(a$) | ||
{{Cl|PRINT}} {{Cl|MID$}}(a$, x, 1); | {{Cl|PRINT}} {{Cl|MID$ (function)|MID$}}(a$, x, 1); | ||
{{Cl|_DELAY}} 0.02 | {{Cl|_DELAY}} 0.02 | ||
{{Cl|NEXT}} | {{Cl|NEXT}} | ||
Line 41: | Line 41: | ||
* [[ON STRIG(n)]] | * [[ON STRIG(n)]] | ||
* [[STRIG]], [[STICK]] | * [[STRIG]], [[STICK]] | ||
* [ | * [[Wikipedia:Analog stick|Single and Dual Stick Controllers]] | ||
{{PageNavigation}} | {{PageNavigation}} |
Latest revision as of 16:33, 14 June 2024
The STRIG(n) statement controls event trapping for a particular joystick or game pad device button.
Syntax
- QuickBASIC
- STRIG(button%) {ON|OFF|STOP}
- QB64
- STRIG[(button_function%[, device_number%])] {ON|OFF|STOP}
Description
- button function specifies the device's button function. Even functions record events while odd ones read the actual presses.
- QB64 can designate a button function and controller device number from 0 to 256.
- When no parameters are used QB64 enables, disables or suspends the reading of ALL button events.
- ON specifies that event trapping is turned on for the specified button.
- OFF specifies that event trapping is turned off for the specified button.
- If STOP is specified, event trapping is suspended for the specified button. Further joystick button events are remembered and trapped, in order, after the next STRIG(n) ON statement is used.
Examples
Example:
ON STRIG(0) GOSUB 10 STRIG(0)ON DO PRINT "."; _LIMIT 30 LOOP UNTIL INKEY$ <> "" END 10 a$ = "[STRIG 0 EVENT]" FOR x = 1 TO LEN(a$) PRINT MID$(a$, x, 1); _DELAY 0.02 NEXT RETURN |
See also