Moin
Wie kann ich in gwbasic Tastaturabfragen starten?
Mein Problem:
Per out-befehl Leds zum laufen bringen(auf einer Ledanzeige sollen sich diese im Kreis drehen) und diese dann per tastendruck schneller oder langsamer/links oder rechts bewegen zu lassen.
Thx jetzt schon mal.
gwbasic Tastaturabfrage
- C4rizz
- Beiträge: 223
- Registriert: 01.05.2006 12:43
- Computerausstattung: Desktop : Amd Athlon X2 3,2 ghz Black Edition. 4GB Corsair XMS DDR2, nVidia 460 gtx Sonic Extreme
Notebook : [Asus] i5 @ 2,9 ghz, 8GB Corsair DDR3, nVidia gt 540m
Internet : DSL - 16 Mbit | HSDPA - 7,2 Mbit - Wohnort: Celle
gwbasic Tastaturabfrage
PB 3.94/4.10
Meine Hompage
Meine Hompage
- LukasBanana
- Beiträge: 150
- Registriert: 14.03.2007 19:13
- Kontaktdaten:
Was du programmierst auf GW Basic? Ist das nicht die Programmiersprache die im DOS- Modus läuft?
Ich hab zu meinen Anfängen auf QuickBasic programmiert, ich hab allerdings ein Buch von GW Basic, der Syntax müsste aber eigentlich sehr ähnlich sein!
Versuch dochmal folgenden Code (Ich hab aber bisher nur die F Tasten, also von F1-F10 abfragen können
):
Tut mir leid das du erst so spät eine Antwort bekommen hast, hoffe ich konnte helfen! 

Ich hab zu meinen Anfängen auf QuickBasic programmiert, ich hab allerdings ein Buch von GW Basic, der Syntax müsste aber eigentlich sehr ähnlich sein!
Versuch dochmal folgenden Code (Ich hab aber bisher nur die F Tasten, also von F1-F10 abfragen können

Code: Alles auswählen
KEY(3) ON ' Taste F3 aktivieren
ON KEY(3) GOSUB lable1 ' Beim Tastendruck der F3 Taste gehe zu lable1
lable1:
RETURN

Mein GitHub Profil: https://github.com/LukasBanana
Main YouTube Channel: https://www.youtube.com/user/SoftPixel
Meine 3D Engine: http://softpixelengine.sourceforge.net/
Main YouTube Channel: https://www.youtube.com/user/SoftPixel
Meine 3D Engine: http://softpixelengine.sourceforge.net/
KEY(n) Statement
Purpose:
To initiate and terminate key capture in a GW-BASIC program.
Syntax:
KEY(n) ON
KEY(n) OFF
KEY(n) STOP
Comments:
n is a number from 1 to 20 that indicates which key is to be captured. Keys are numbered as
follows:
Key Number Key
1-10 Function keys F1 through F10
11 CURSOR-UP
12 CURSOR-LEFT
13 CURSOR-RIGHT
14 CURSOR-DOWN
15-20 Keys defined in the following format (see KEY statement):
KEY n,CHR$(hexcode)+CHR$(scan code)
Execution of the KEY(n) ON statement is required to activate keystroke cature from the function
keys or cursor control keys. When the KEY(n) ON statement is activated and enabled, GWBASIC
checks each new statement to see if the specified key is pressed. If so, GW-BASIC
performs a GOSUB to the line number specified in the ON KEY(n) statement. An ON KEY(n)
statement must precede a KEY(n) statement.
When KEY(n) OFF is executed, no key capture occurs and no keystrokes are retained.
If KEY(n) STOP is executed, no key capture occurs, but if a specified key is pressed, the
keystroke is retained so that immediate keystroke capture occurs when a KEY(n) ON is
executed.
For further information on key trapping, see the ON KEY (n) statement.
hier guggn
http://www.gwbasic.at/download.htm
pb aktuel 6.2 windoof aktuell und sowas von 10
Ich hab Tinnitus im Auge. Ich seh nur Pfeifen.
Ich hab Tinnitus im Auge. Ich seh nur Pfeifen.