Code: Alles auswählen
InitSprite()
InitKeyboard()
InitMouse()
OpenWindow(0,0,0,300,300,#PB_Window_SystemMenu,"Tasten Scanner")
If OpenWindow(0,0,0,300,300,#PB_Window_SystemMenu,"Tasten Scanner") =0
MessageRequester("Error","Funktion 1 n.i.O.",#PB_MessageRequester_Ok)
EndIf
OpenWindowedScreen(WindowID(0),0,0,300,300,0,0,0)
If OpenWindowedScreen(WindowID(0),0,0,300,300,0,0,0) =0
MessageRequester("Error","Funktion 2 n.i.O.",#PB_MessageRequester_Ok)
EndIf
LoadJPEGSprite(0,"I:\PB\Progs\TCS Window\GFX\NSA.jpg",0)
Global Taste.w
Taste = 0
Repeat
ExamineKeyboard()
ExamineMouse()
ClearScreen(0,0,0)
EventID.l = WaitWindowEvent()
DisplayTransparentSprite(0,0,0)
StartDrawing(ScreenOutput())
DrawingMode(1)
Locate(5,5)
FrontColor(0,255,0)
DrawText("Tastencode: "+Str(Taste))
Locate(137,283)
FrontColor(0,255,0)
DrawText("Copyright by N.S.A. 2008")
StopDrawing()
FlipBuffers()
If KeyboardPushed(200)
Taste=200
EndIf
If EventID = #PB_Event_CloseWindow Or KeyboardPushed(1)
Ende = 1
EndIf
FlipBuffers()
Until Ende = 1