Neues Problem; wieder mit der Tastatur
Verfasst: 19.06.2014 14:58
Hallo liebe Leute,
ich muss schon wieder etwas nachfragen.
in meinem ersten Thread => "Anfängerprobleme beim ersten Programm"
habe ich ja schon Probleme mit der Tastatursteuerung gehabt.
Mit Eurer Hilfe konnte ich dann einenSteuerung entwickeln, die zumindest die normalen
Tasten korrekt wiedergibt.
Ich habe das jetzt noch einmal vertieft, und meine, einen Fehler in PureBasic
gefunden zu haben. Ich will mich da aber nicht zu weit aus dem Fenster lehnen,
schließlich bin ich noch Anfänger in PB.
Trotzdem muss es doch irgendeine Lösung geben.
Ich habe alle 128 Threads die es im Forum zu Thema Tastatur gibt zumindest überflogen,
bin aber noch nicht auf eine wirklich gültige Lösung gestossen.
Das Problem liegt meine ich darin, dass PB nicht die genormten Scancodes der Tastatur für seine Key-Konstanten benutzt, sondern selbt gewählte Zahlen.
Unten findet Ihr ein Testprogramm, welches man wahlweise mit Waitstring() aktiv
oder waitstring2() aktiv kompilieren kann.
Bei beiden ergeben sich Fehler in der Tastaturabfrage.
In waitstring wird die PB-tastennummer und der Modifier ausgelesen.
Da eine Prozedur nur einen einzigen Wert zurückliefern kann, habe ich den
Modifier mit 1000 multipliziert und zum Tastenwert addiert.
Taste (alleine) (+shift) (+ctrl) (+shift+ctrl) Numlock-Status
i 73 1073 4073 5073 1 ok
i 73 1073 4073 5073 0 ok
l 76 1076 4076 5076 1 ok
l 76 1076 4076 5076 0 ok
k 75 1075 4075 5075 1 ok
k 75 1075 4075 5075 0 ok
j 74 1074 4074 5074 1 ok
j 74 1074 4074 5074 0 ok
cursor up 38 1038 4038 5038 1 ok
cursor up 38 1038 4038 5038 0 ok
cursor re 39 1039 4039 5039 1 ok
cursor re 39 1039 4039 5039 0 ok
cursor dn 40 1040 4040 5040 1 ok
cursor dn 40 1040 4040 5040 0 ok
Numpad 5 101 12 4101 4016 (shift) 1 nicht ok
+4012
+4016 (shift)
+17 (ctrl)
Numpad 5 12 1012 4012 5012 0 ok
Numpad 3 99 34 4099 mehrere+4034 1 nicht ok
Numpad 3 34 1034 4034 5034 0 ok
Numpad 2 98 40 4098 mehrere+4040 1 nicht ok
Numpad 2 35 1035 4035 5035 0 ok
Numpad 1 97 35 4097 mehrere+4035 1 nicht ok
Numpad 1 35 1035 4035 5035 0 ok
[/list]
Das heisst, dass GetGadgetAttribute(#cv001,#PB_Canvas_Modifiers) die
Modifier bei eingeschaltetem Numlock nicht korrekt übergibt.
Trotzdem könnt man diesen Fehler noch abfangen, wenn man zusätzlich den
Numlockstatus überprüft und berücksichtigt.
Nicht zu beheben ist aber der Fehler bei der Taste Numpad 2
Bei cursor down ohne shift wird 40 zurückgeliefert wenn Numlock eingeschaltet ist
Bei numpad 2 mit shift wird aber auch 40 zurückgeliefert wenn numlock eingeschaltet ist
Das heißt, es wird der gleiche wert bei 2 unterschiedlichen Tasten zurückgeliefert
und dann auch noch jeweils einmal bei gedrücktem Shift und einmal ohne
Daher habe ich mir die Mühe Gemacht und Waitstring 2 geschrieben.
Hier habe ich die addkeyshortcuts benutzt. Leider war das Ergebnis völlig unbrauchbar
ich habe die Tastaturshortcuts benannt #kb000 fortlaufend mit Enumeration beginnend bei 100
Taste (alleine) (+shift) (+ctrl) (+shift+ctrl) Numlock-Status
i 101 102 103 104 1 + 0 ok
l 105 106 107 108 1 + 0 ok
k 109 110 111 112 1 + 0 ok
j 113 114 115 116 1 + 0 ok
cursor up 117 118 119 120 1 + 0 ok
cursor re 121 122 123 124 1 + 0 ok
cursor dn 125 126 127 128 1 + 0 ok
cursor li 129 130 131 132 1 + 0 ok
numpad 5 133 - 135 - 1
numpad 5 - - - - 0
numpad 3 - - - - 1
numpad 3 137 - 139 - 0
numpad 2 141 125 143 127 1
numpad 2 125 126 127 128 0
numpad 1 145 - 147 - 1
numpad 1 - - - - 0
Hat denn hier im Forum noch niemand Tastatureingaben abfangen müssen ?
Oder hat niemand außer mir Probleme und ich bin nur zu blöd?
Außerdem: wenn ich die ganze Tastatur abfragen wollte mit den entsprechenden Modifiern -
und <alt> habe ich noch gar nicht eingebaut - dann müßte man ja 105 Tasten mal
mind. 4 Zustände =620 addkeys definieren und 620 cases abfangen.
Weiteres Problem, wenn ich einen Flipper schreiben will, der mit der rechten und
linken shift-taste gespielt wird, dann kann ich doch mit code 16 nichts anfangen,
dann benötige ich doch zwingend die Scancodes 42 linkes Shift und 54 rechtes shift
oder 56 für alt und 184 für altgr
Kann sich da bitte jemand meiner erbarmen ?
Ich entschuldige mich auch gleich für die Menge Text, aber ich wollte das Problem
exakt schildern.
ich muss schon wieder etwas nachfragen.
in meinem ersten Thread => "Anfängerprobleme beim ersten Programm"
habe ich ja schon Probleme mit der Tastatursteuerung gehabt.
Mit Eurer Hilfe konnte ich dann einenSteuerung entwickeln, die zumindest die normalen
Tasten korrekt wiedergibt.
Ich habe das jetzt noch einmal vertieft, und meine, einen Fehler in PureBasic
gefunden zu haben. Ich will mich da aber nicht zu weit aus dem Fenster lehnen,
schließlich bin ich noch Anfänger in PB.
Trotzdem muss es doch irgendeine Lösung geben.
Ich habe alle 128 Threads die es im Forum zu Thema Tastatur gibt zumindest überflogen,
bin aber noch nicht auf eine wirklich gültige Lösung gestossen.
Das Problem liegt meine ich darin, dass PB nicht die genormten Scancodes der Tastatur für seine Key-Konstanten benutzt, sondern selbt gewählte Zahlen.
Unten findet Ihr ein Testprogramm, welches man wahlweise mit Waitstring() aktiv
oder waitstring2() aktiv kompilieren kann.
Bei beiden ergeben sich Fehler in der Tastaturabfrage.
In waitstring wird die PB-tastennummer und der Modifier ausgelesen.
Da eine Prozedur nur einen einzigen Wert zurückliefern kann, habe ich den
Modifier mit 1000 multipliziert und zum Tastenwert addiert.
Taste (alleine) (+shift) (+ctrl) (+shift+ctrl) Numlock-Status
i 73 1073 4073 5073 1 ok
i 73 1073 4073 5073 0 ok
l 76 1076 4076 5076 1 ok
l 76 1076 4076 5076 0 ok
k 75 1075 4075 5075 1 ok
k 75 1075 4075 5075 0 ok
j 74 1074 4074 5074 1 ok
j 74 1074 4074 5074 0 ok
cursor up 38 1038 4038 5038 1 ok
cursor up 38 1038 4038 5038 0 ok
cursor re 39 1039 4039 5039 1 ok
cursor re 39 1039 4039 5039 0 ok
cursor dn 40 1040 4040 5040 1 ok
cursor dn 40 1040 4040 5040 0 ok
Numpad 5 101 12 4101 4016 (shift) 1 nicht ok
+4012
+4016 (shift)
+17 (ctrl)
Numpad 5 12 1012 4012 5012 0 ok
Numpad 3 99 34 4099 mehrere+4034 1 nicht ok
Numpad 3 34 1034 4034 5034 0 ok
Numpad 2 98 40 4098 mehrere+4040 1 nicht ok
Numpad 2 35 1035 4035 5035 0 ok
Numpad 1 97 35 4097 mehrere+4035 1 nicht ok
Numpad 1 35 1035 4035 5035 0 ok
[/list]
Das heisst, dass GetGadgetAttribute(#cv001,#PB_Canvas_Modifiers) die
Modifier bei eingeschaltetem Numlock nicht korrekt übergibt.
Trotzdem könnt man diesen Fehler noch abfangen, wenn man zusätzlich den
Numlockstatus überprüft und berücksichtigt.
Nicht zu beheben ist aber der Fehler bei der Taste Numpad 2
Bei cursor down ohne shift wird 40 zurückgeliefert wenn Numlock eingeschaltet ist
Bei numpad 2 mit shift wird aber auch 40 zurückgeliefert wenn numlock eingeschaltet ist
Das heißt, es wird der gleiche wert bei 2 unterschiedlichen Tasten zurückgeliefert
und dann auch noch jeweils einmal bei gedrücktem Shift und einmal ohne
Daher habe ich mir die Mühe Gemacht und Waitstring 2 geschrieben.
Hier habe ich die addkeyshortcuts benutzt. Leider war das Ergebnis völlig unbrauchbar
ich habe die Tastaturshortcuts benannt #kb000 fortlaufend mit Enumeration beginnend bei 100
Taste (alleine) (+shift) (+ctrl) (+shift+ctrl) Numlock-Status
i 101 102 103 104 1 + 0 ok
l 105 106 107 108 1 + 0 ok
k 109 110 111 112 1 + 0 ok
j 113 114 115 116 1 + 0 ok
cursor up 117 118 119 120 1 + 0 ok
cursor re 121 122 123 124 1 + 0 ok
cursor dn 125 126 127 128 1 + 0 ok
cursor li 129 130 131 132 1 + 0 ok
numpad 5 133 - 135 - 1
numpad 5 - - - - 0
numpad 3 - - - - 1
numpad 3 137 - 139 - 0
numpad 2 141 125 143 127 1
numpad 2 125 126 127 128 0
numpad 1 145 - 147 - 1
numpad 1 - - - - 0
Hat denn hier im Forum noch niemand Tastatureingaben abfangen müssen ?
Oder hat niemand außer mir Probleme und ich bin nur zu blöd?
Außerdem: wenn ich die ganze Tastatur abfragen wollte mit den entsprechenden Modifiern -
und <alt> habe ich noch gar nicht eingebaut - dann müßte man ja 105 Tasten mal
mind. 4 Zustände =620 addkeys definieren und 620 cases abfangen.
Weiteres Problem, wenn ich einen Flipper schreiben will, der mit der rechten und
linken shift-taste gespielt wird, dann kann ich doch mit code 16 nichts anfangen,
dann benötige ich doch zwingend die Scancodes 42 linkes Shift und 54 rechtes shift
oder 56 für alt und 184 für altgr
Kann sich da bitte jemand meiner erbarmen ?
Ich entschuldige mich auch gleich für die Menge Text, aber ich wollte das Problem
exakt schildern.
Code: Alles auswählen
EnableExplicit
Declare meldunten(meldu$)
Declare melduloesch()
Declare WAITSTRING1()
Declare waitstring2()
Declare auswertung(taste,shift,alt,ctrl,tnum,tcap,tscr)
Define titel$="Keyboardtest"
Define quiT,taste,shift,alt,ctrl,ric,tnum,tcap,tscr
quit=0:taste=0:shift=0:alt=0:ctrl=0:ric=0:tnum=0:tcap=0:tscr=0
; -------------------------------------------------------------
Enumeration 100; Tasten
#kb000
#kb001
#kb002
#kb003
#kb004
#kb005
#kb006
#kb007
#kb008
#kb009
#kb010
#kb011
#kb012
#kb013
#kb014
#kb015
#kb016
#kb017
#kb018
#kb019
#kb020
#kb021
#kb022
#kb023
#kb024
#kb025
#kb026
#kb027
#kb028
#kb029
#kb030
#kb031
#kb032
#kb033
#kb034
#kb035
#kb036
#kb037
#kb038
#kb039
#kb040
#kb041
#kb042
#kb043
#kb044
#kb045
#kb046
#kb047
#kb048
EndEnumeration
Enumeration ; Canvas
#cv001
EndEnumeration
; -------------------------------------------------------------
;hier werden die Schriften vorgeladen, damit sie im Programm zur Verfügung stehen
LoadFont(1,"Arial",32)
LoadFont(2,"Bookman Old Style",18,#PB_Font_Bold )
; -------------------------------------------------------------
;hier wird das Hauptfenster geöffnet
OpenWindow(0,300,100,1024,768,titel$,#PB_Window_SystemMenu |#PB_Window_MinimizeGadget)
CanvasGadget(#cv001,0,0,1024,768,#PB_Canvas_ClipMouse|#PB_Canvas_Keyboard)
AddKeyboardShortcut(0,#PB_Shortcut_All,#kb000)
; --
AddKeyboardShortcut(0,#PB_Shortcut_I,#kb001)
AddKeyboardShortcut(0,#PB_Shortcut_I|#PB_Shortcut_Shift,#kb002)
AddKeyboardShortcut(0,#PB_Shortcut_I|#PB_Shortcut_Control,#kb003)
AddKeyboardShortcut(0,#PB_Shortcut_I|#PB_Shortcut_Shift|#PB_Shortcut_Control,#kb004)
AddKeyboardShortcut(0,#PB_Shortcut_L,#kb005)
AddKeyboardShortcut(0,#PB_Shortcut_L|#PB_Shortcut_Shift,#kb006)
AddKeyboardShortcut(0,#PB_Shortcut_L|#PB_Shortcut_Control,#kb007)
AddKeyboardShortcut(0,#PB_Shortcut_L|#PB_Shortcut_Shift|#PB_Shortcut_Control,#kb008)
AddKeyboardShortcut(0,#PB_Shortcut_K,#kb009)
AddKeyboardShortcut(0,#PB_Shortcut_K|#PB_Shortcut_Shift,#kb010)
AddKeyboardShortcut(0,#PB_Shortcut_K|#PB_Shortcut_Control,#kb011)
AddKeyboardShortcut(0,#PB_Shortcut_K|#PB_Shortcut_Shift|#PB_Shortcut_Control,#kb012)
AddKeyboardShortcut(0,#PB_Shortcut_J,#kb013)
AddKeyboardShortcut(0,#PB_Shortcut_J|#PB_Shortcut_Shift,#kb014)
AddKeyboardShortcut(0,#PB_Shortcut_J|#PB_Shortcut_Control,#kb015)
AddKeyboardShortcut(0,#PB_Shortcut_J|#PB_Shortcut_Shift|#PB_Shortcut_Control,#kb016)
; --
AddKeyboardShortcut(0,#PB_Shortcut_Up,#kb017)
AddKeyboardShortcut(0,#PB_Shortcut_Up|#PB_Shortcut_Shift,#kb018)
AddKeyboardShortcut(0,#PB_Shortcut_Up|#PB_Shortcut_Control,#kb019)
AddKeyboardShortcut(0,#PB_Shortcut_Up|#PB_Shortcut_Shift|#PB_Shortcut_Control,#kb020)
AddKeyboardShortcut(0,#PB_Shortcut_Right,#kb021)
AddKeyboardShortcut(0,#PB_Shortcut_Right|#PB_Shortcut_Shift,#kb022)
AddKeyboardShortcut(0,#PB_Shortcut_Right|#PB_Shortcut_Control,#kb023)
AddKeyboardShortcut(0,#PB_Shortcut_Right|#PB_Shortcut_Shift|#PB_Shortcut_Control,#kb024)
AddKeyboardShortcut(0,#PB_Shortcut_Down,#kb025)
AddKeyboardShortcut(0,#PB_Shortcut_Down|#PB_Shortcut_Shift,#kb026)
AddKeyboardShortcut(0,#PB_Shortcut_Down|#PB_Shortcut_Control,#kb027)
AddKeyboardShortcut(0,#PB_Shortcut_Down|#PB_Shortcut_Shift|#PB_Shortcut_Control,#kb028)
AddKeyboardShortcut(0,#PB_Shortcut_Left,#kb029)
AddKeyboardShortcut(0,#PB_Shortcut_Left|#PB_Shortcut_Shift,#kb030)
AddKeyboardShortcut(0,#PB_Shortcut_Left|#PB_Shortcut_Control,#kb031)
AddKeyboardShortcut(0,#PB_Shortcut_Left|#PB_Shortcut_Shift|#PB_Shortcut_Control,#kb032)
; --
AddKeyboardShortcut(0,#PB_Shortcut_Pad5,#kb033)
AddKeyboardShortcut(0,#PB_Shortcut_Pad5|#PB_Shortcut_Shift,#kb034)
AddKeyboardShortcut(0,#PB_Shortcut_Pad5|#PB_Shortcut_Control,#kb035)
AddKeyboardShortcut(0,#PB_Shortcut_Pad5|#PB_Shortcut_Shift|#PB_Shortcut_Control,#kb036)
AddKeyboardShortcut(0,#PB_Shortcut_Pad3,#kb037)
AddKeyboardShortcut(0,#PB_Shortcut_Pad3|#PB_Shortcut_Shift,#kb038)
AddKeyboardShortcut(0,#PB_Shortcut_Pad3|#PB_Shortcut_Control,#kb039)
AddKeyboardShortcut(0,#PB_Shortcut_Pad3|#PB_Shortcut_Shift|#PB_Shortcut_Control,#kb040)
AddKeyboardShortcut(0,#PB_Shortcut_Pad2,#kb041)
AddKeyboardShortcut(0,#PB_Shortcut_Pad2|#PB_Shortcut_Shift,#kb042)
AddKeyboardShortcut(0,#PB_Shortcut_Pad2|#PB_Shortcut_Control,#kb043)
AddKeyboardShortcut(0,#PB_Shortcut_Pad2|#PB_Shortcut_Shift|#PB_Shortcut_Control,#kb044)
AddKeyboardShortcut(0,#PB_Shortcut_Pad1,#kb045)
AddKeyboardShortcut(0,#PB_Shortcut_Pad1|#PB_Shortcut_Shift,#kb046)
AddKeyboardShortcut(0,#PB_Shortcut_Pad1|#PB_Shortcut_Control,#kb047)
AddKeyboardShortcut(0,#PB_Shortcut_Pad1|#PB_Shortcut_Shift|#PB_Shortcut_Control,#kb048)
; --
SetActiveGadget(#cv001) ;wichtig: Tastatur funktioniert sonst nicht
; -------------------------------------------------------------
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;Debug GetKeyState_(#VK_NUMLOCK) & 1
;Debug GetKeyState_(#VK_CAPITAL) & 1
;Debug GetKeyState_(#VK_SCROLL) & 1
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
schleife:
quit=0
Repeat
taste=0:shift=0:alt=0:ctrl=0:ric=0
; hier entweder waitstring1() oder waitstring2 aktivieren und neu kompilieren
; taste=waitstring1()
taste=WAITstring2()
tnum=GetKeyState_(#VK_NUMLOCK) & 1
tcap=GetKeyState_(#VK_CAPITAL) & 1
tscr=GetKeyState_(#VK_SCROLL) & 1
meldunten("NUM: "+Str(tnum)+" CAPS: "+Str(tcap)+" SCROLL: "+Str(tscr)+" TAS: "+Str(taste))
Delay (2000)
meldunten(".")
;auswertung(taste,shift,alt,ctrl,tnum,tcap,tscr)
If taste=9999:quit=1:EndIf
If taste=27:quit=1:EndIf
Until quit=1
Meldunten("Programmende"):Delay(1000)
End
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Procedure MELDUNTEN(meldu$)
Protected fa1,fa2,fa3
fa1=RGB( 0, 0, 0)
fa2=RGB(185,015, 0)
fa3=RGB(255,255, 0)
If StartDrawing(CanvasOutput(#cv001))
FrontColor(fa1):Box (0,704,1024, 32)
FrontColor(fa2):Box (1,705,1022, 30)
DrawingFont(FontID(2)):DrawingMode(1)
DrawText(101,707,meldu$,fa1)
DrawText(100,706,meldu$,fa3)
StopDrawing()
EndIf
EndProcedure
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Procedure MELDULOESCH()
Protected fa1,fa2,fa3
fa1=RGB( 0, 0, 0)
fa2=RGB(200,200,200)
StartDrawing(CanvasOutput(#cv001))
FrontColor(fa1):Box (0,704,1024, 32)
FrontColor(fa2):Box (1,705,1022, 30)
StopDrawing()
EndProcedure
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Procedure WAITSTRING1()
Protected quit,taste,modif,event
quit=0:taste=0:modif=0:event=0
Repeat
taste=0
Event = WaitWindowEvent()
Select event
Case #PB_Event_Gadget
If EventGadget()=#cv001
If EventType() = #PB_EventType_KeyUp
taste=((GetGadgetAttribute(#cv001,#PB_Canvas_Key)))
modif=((GetGadgetAttribute(#cv001,#PB_Canvas_Modifiers)))
EndIf
modif=modif*1000
taste=taste+modif
EndIf
; If EventType() = #PB_EventType_LeftButtonDown
; tastex=GetGadgetAttribute(#cv001,#PB_Canvas_MouseX)
; tastey=GetGadgetAttribute(#cv001,#PB_Canvas_MouseY)
; EndIf
; If EventType() = #PB_EventType_RightButtonDown
; tastex=GetGadgetAttribute(#cv001,#PB_Canvas_MouseX)
; tastey=GetGadgetAttribute(#cv001,#PB_Canvas_MouseY)
; EndIf
Case #PB_Event_CloseWindow
quit=1:taste=9999
EndSelect
If Taste>0 : quit=1 : EndIf
Until quit=1
; Meldunten("Waitstring: "+Str(taste)):Delay(1200)
ProcedureReturn taste
EndProcedure
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Procedure WAITSTRING2()
Protected quit,taste,modif,event
quit=0:taste=0:event=0
Repeat
taste=0
Event = WaitWindowEvent()
If event=#PB_Event_Menu
Select EventMenu()
Case #kb000
taste=#kb000
Case #kb001
taste=#kb001
Case #kb002
taste=#kb002
Case #kb003
taste=#kb003
Case #kb004
taste=#kb004
Case #kb005
taste=#kb005
Case #kb006
taste=#kb006
Case #kb007
taste=#kb007
Case #kb008
taste=#kb008
Case #kb009
taste=#kb009
Case #kb010
taste=#kb010
Case #kb011
taste=#kb011
Case #kb012
taste=#kb012
Case #kb013
taste=#kb013
Case #kb014
taste=#kb014
Case #kb015
taste=#kb015
Case #kb016
taste=#kb016
Case #kb017
taste=#kb017
Case #kb018
taste=#kb018
Case #kb019
taste=#kb019
Case #kb020
taste=#kb020
Case #kb021
taste=#kb021
Case #kb022
taste=#kb022
Case #kb023
taste=#kb023
Case #kb024
taste=#kb024
Case #kb025
taste=#kb025
Case #kb026
taste=#kb026
Case #kb027
taste=#kb027
Case #kb028
taste=#kb028
Case #kb029
taste=#kb029
Case #kb030
taste=#kb030
Case #kb031
taste=#kb031
Case #kb032
taste=#kb032
Case #kb033
taste=#kb033
Case #kb034
taste=#kb034
Case #kb035
taste=#kb035
Case #kb036
taste=#kb036
Case #kb037
taste=#kb037
Case #kb038
taste=#kb038
Case #kb039
taste=#kb039
Case #kb040
taste=#kb040
Case #kb041
taste=#kb041
Case #kb042
taste=#kb042
Case #kb043
taste=#kb043
Case #kb044
taste=#kb044
Case #kb045
taste=#kb045
Case #kb046
taste=#kb046
Case #kb047
taste=#kb047
Case #kb048
taste=#kb048
EndSelect
EndIf
If event=#PB_Event_CloseWindow
quit=1:taste=9999
EndIf
If Taste>0 : quit=1 : EndIf
Until quit=1
; Meldunten("Waitsring: "+Str(taste)):Delay(1200)
ProcedureReturn taste
EndProcedure
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++