Capturing keyboard events without window focus
Chris Weiland
hobbiticus at gmail.com
Tue Jun 5 06:21:17 PDT 2007
OK, I think I've figured it out. I thought that the dialog would receive
the event then decide which control within that dialog would get it. So, I
made a new class inherited from wxStaticText that would capture key events
and use them in such a way as to make my dialog do what I want.
I also used a timer to poll the state of the transmit key every tenth of a
second, which seems to work just fine.
Thank for the help!
On 6/4/07, Vadim Zeitlin <vadim at wxwidgets.org> wrote:
>
> 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/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20070605/ce2=
c9c7d/attachment.htm
More information about the wx-users
mailing list