Keydown vs. GUI

BlitzMax Forums/BlitzMax GUI Programming/Keydown vs. GUI

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

You'll need a canvas/panel to capture EVENT_KEYDOWN
' createwindow.bmx

Strict 

Local window:TGadget

window=CreateWindow("My Window",40,40,320,240)
Global panel:TGadget = CreatePanel(0,0,320,240,window,PANEL_ACTIVE)
ActivateGadget pan

While True
	WaitEvent 
	Print CurrentEvent.ToString()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
		Case EVENT_KEYDOWN
			Select EventData()
				Case KEY_ESCAPE
					End
			End Select
	End Select
Wend