Here is an example of the problem, use the left arrow key to change screen colour.
Also if you change KEY_LEFT to KEY_ESCAPE then nothing ever happens?
I am using Suse 10.1 not sure if this matters or not.
Also if you change KEY_LEFT to KEY_ESCAPE then nothing ever happens?
I am using Suse 10.1 not sure if this matters or not.
Const WINDOW_WIDTH=640 Const WINDOW_HEIGHT=384 Local wx=(GadgetWidth(Desktop())-WINDOW_WIDTH)/2 Local wy=(GadgetHeight(Desktop())-WINDOW_HEIGHT)/2 Global main_window:TGadget = CreateWindow( Title$,wx,wy,WINDOW_WIDTH,WINDOW_HEIGHT,Null,WINDOW_TITLEBAR | WINDOW_CLIENTCOORDS) Global canvas:TGadget=CreateCanvas(0,0,WINDOW_WIDTH,WINDOW_HEIGHT,main_window) SetGraphics CanvasGraphics(canvas) ActivateGadget canvas CreateTimer(10) enablepolledinput() While WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_TIMERTICK If KeyDown(KEY_LEFT) SetClsColor Rnd(255),Rnd(255),Rnd(255) Cls Flip EndIf EndSelect End While