Capturing keyboard events without window focus

Vadim Zeitlin vadim at wxwidgets.org
Mon Jun 4 09:53:52 PDT 2007


On Mon, 4 Jun 2007 12:18:08 -0400 Chris Weiland <hobbiticus at gmail.com> wrote:

CW> I don't think that I should even need the EVT_KEY_DOWN or EVT_CHAR events
CW> handled as long as I am overriding ProcessEvent,

 You don't need an event table if you dispatch them manually, right.

CW> Also, after testing this on linux, I don't get any key press events at
CW> all.

 Again, this is because these events are not sent to the dialog in the
first place. They're sent to the control which currently has focus.

 Also, you shouldn't need a handler for WXK_ESCAPE anyhow, this is managed
automatically by wxWidgets as long as you have a button with wxID_CANCEL id
in your dialog (if you have a button with another id you can use wxDialog::
SetEscapeId()).

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list