[wxPython] Preprocessing key-events in wxTextCtrl

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] Preprocessing key-events in wxTextCtrl

Alexander.Stigsen

I am trying to catch keyevents in a wxTextCtrl so that I can process them
before they reach
the control. Catching them works fine using OnChar but can't find a way to
pass the event on
to the control after I've dealt with them.

Have anyone tried this before?

- Alexander




_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Preprocessing key-events in wxTextCtrl

Robin Dunn
>
> I am trying to catch keyevents in a wxTextCtrl so that I can process them
> before they reach
> the control. Catching them works fine using OnChar but can't find a way to
> pass the event on
> to the control after I've dealt with them.
>

In any event handler calling event.Skip() specifies that the system should
keep searching for handlers for this event.  If you call this when you want
the wxTextCtrl to also get the key then the default event handler will still
be called.  If you don't call event.Skip then the system assumes that the
event has been completely processed and does no more searching.

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users