1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-20 20:55:13 +00:00
qb64/internal/help/STRIG(n).txt
Luke Ceddia b586eafd3b Integrated _BLINEINPUT into regular LINE INPUT for BINARY files
LINE INPUT will now use the faster method if passed a file handle
that has been opened FOR BINARY. As such, the _BLINEINPUT command
has been removed.

qb64.bas now takes advantage of this for reading from '$include files,
at least in Include Manager 1. Some tweaking of internal/source/main.txt
was required to get things into a sane state, so I'm holing off changing
the compiler any further so the auto-builder can make sure everything's
smoothed over.

Note: Everything should still compile as normal; I'm just being overcautious.
2014-07-27 00:06:17 +10:00

48 lines
1.6 KiB
Plaintext

The {{KW|STRIG(n)}} statement controls event trapping for a particular joystick or game pad device button.
{{PageSyntax}}
::STRIG({{Parameter|button%}}) {ON|OFF|STOP}
QB64 {{PageSyntax}}
::STRIG[(''button_function%''[, ''device_number%''])] {ON|OFF|STOP}
{{PageDescription}}
* {{Parameter|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.
* [[STRIG(n)|ON]] specifies that event trapping is turned on for the specified button.
* [[STRIG(n)|OFF]] specifies that event trapping is turned off for the specified button.
* If {{KW|STRIG(n)|STOP}} is specified, event trapping is suspended for the specified button. Further joystick button events are remembered and trapped, in order, after the next {{KW|STRIG(n)|STRIG(n) ON}} statement is used.
''Example:''
{{CodeStart}} '' ''
{{Cl|ON STRIG(n)|ON STRIG}}(0) {{Cl|GOSUB}} 10
{{Cl|STRIG(n)|STRIG}}(0)ON
DO
{{Cl|PRINT}} ".";
{{Cl|_LIMIT}} 30
{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> ""
{{Cl|END}}
10
a$ = "[STRIG 0 EVENT]"
{{Cl|FOR...NEXT|FOR}} x = 1 {{Cl|TO}} {{Cl|LEN}}(a$)
{{Cl|PRINT}} {{Cl|MID$}}(a$, x, 1);
{{Cl|_DELAY}} 0.02
{{Cl|NEXT}}
{{Cl|RETURN}} '' ''
{{CodeEnd}}
{{PageSeeAlso}}
* [[ON STRIG(n)]] {{text|(event statement)}}
* [[STRIG]], [[STICK]] {{text|(functions)}}
* [http://en.wikipedia.org/wiki/Analog_stick Single and Dual Stick Controllers]
{{PageNavigation}}