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() == 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.