How would I use a select case for keydown?
I would use if but isn't select faster?
if so. Why does this code not work. And what is the right way?
I would use if but isn't select faster?
if so. Why does this code not work. And what is the right way?
DXRenderType = TnL Graphics 640,480,0 refreshTimer:TTimer = CreateTimer(60) Repeat WaitEvent() Select EventID() Case EVENT_TIMERTICK KEY = GetChar() Select KEY Case KeyDown(KEY_UP) Cls DrawText "UP Pressed", 10, 10 Flip Case KeyDown(KEY_DOWN) Cls DrawText "DOWN Pressed", 10, 10 Flip Case KeyDown(KEY_LEFT) Cls DrawText "LEFT Pressed", 10, 10 Flip Case KeyDown(KEY_RIGHT) Cls DrawText "RIGHT Pressed", 10, 10 Flip Default Cls DrawText "Nothing Pressed", 10, 10 Flip EndSelect EndSelect Until KeyHit(KEY_ESCAPE) Or AppTerminate()