[wxPython-users] event.GetKeyCode()
Saketh Bhamidipati
saketh.bhamidipati at gmail.com
Mon Jul 10 18:29:32 PDT 2006
On 7/10/06, Walter Igo <walterigo at yahoo.com> wrote:
>
> How do i access the GetKeyCode() command. I see it used in other example
> programs, but for some reason I cant initialize it.
>
GetKeyCode() is a method of events. So, for example, you'd use it like this
in a subclass of wx.Frame for an EVT_CHAR. I'm not sure if this is a valid
keycode, but you get the idea.
def OnChar(self, event):
if event.GetKeyCode() =3D=3D WXK_RETURN:
event.Skip()
from what I see people are referancing it with just the self.GetKeyCode()
> command. but it doesnt work for me.
> whats up?
>
People might use self.GetKeyCode() if they are writing their own event
classes. So if you created a class whose parent was an event (such as
CommandEvent or something) then self.GetKeyCode() would work.
-Saketh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200607=
10/db92e9bc/attachment.htm
More information about the wxpython-users
mailing list