' tb-screen: 80x25
' tb-keys: <F3><F2><F1>
' F3 ist ON, F2 OFF, F1 STOP; EVENT OFF verwirft UEVENT.
ON KEY(1) GOSUB K1
ON KEY(2) GOSUB K2
ON KEY(3) GOSUB K3
KEY(1) STOP
KEY(2) OFF
KEY(3) ON
DOEVENTS
IF k1% = 0 AND k2% = 0 AND k3% = 1 THEN PRINT "KEY ON/OFF/STOP: genau F3"
a$ = INKEY$
b$ = INKEY$
IF a$ = CHR$(0) + CHR$(60) THEN PRINT "KEY OFF: F2 lesbar"
IF b$ = CHR$(0) + CHR$(59) THEN PRINT "KEY STOP: F1 lesbar"
IF INKEY$ = "" THEN PRINT "KEY ON: F3 konsumiert"
KEY(1) ON
DOEVENTS
DOEVENTS
IF k1% = 1 THEN PRINT "KEY STOP -> ON: genau einmal"
ON UEVENT GOSUB U
UEVENT OFF
CALL SetUEvent
DOEVENTS
UEVENT ON
DOEVENTS
IF u% = 0 THEN PRINT "UEVENT OFF: verworfen"
CALL SetUEvent
DOEVENTS
IF u% = 1 THEN PRINT "UEVENT ON: zugestellt"
UEVENT STOP
CALL SetUEvent
CALL SetUEvent
DOEVENTS
IF u% = 1 THEN PRINT "UEVENT STOP: gesperrt"
UEVENT ON
DOEVENTS
DOEVENTS
IF u% = 2 THEN PRINT "UEVENT STOP -> ON: genau einmal"
EVENT OFF
CALL SetUEvent
DOEVENTS
IF u% = 2 THEN PRINT "UEVENT EVENT OFF: gesperrt"
EVENT ON
DOEVENTS
IF u% = 2 THEN PRINT "UEVENT EVENT OFF: verworfen"
CALL SetUEvent
DOEVENTS
IF u% = 3 THEN PRINT "UEVENT EVENT ON: wieder aktiv"
END
K1:
k1% = k1% + 1
RETURN
K2:
k2% = k2% + 1
RETURN
K3:
k3% = k3% + 1
RETURN
U:
u% = u% + 1
RETURN
