Capture ESC Key for Dialog in wxEuphoria

new topic     » topic index » view thread      » older message » newer message

How do I capture the ESC key when displaying a wxDialog? I've tried the following, which doesn't work:

procedure dlg_AboutKeyDown(atom this, atom event_type, atom id, atom event) 
	if get_key_code( event ) = 27 then 
		end_modal( dlg_About, 1 ) 
	else 
		skip( event ) 
	end if 
end procedure 
set_event_handler( dlg_About, -1, wxEVT_CHAR, routine_id("dlg_AboutKeyDown")) 

I also tried the wxEVT_KEYDOWN event as well as the wxEVT_CHAR event shown above.

The above code works when I attach it to a edit text control for another dialog box, but there are no such controls on this dialog (except a button). So how do I make it apply to the entire dialog, not just a control?

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu