[wxPython-users] Catching ESCAPE Key
Alec Bennett
wrybread at gmail.com
Wed Jan 24 08:40:25 PST 2007
One way to do it under Windows:
i = win32api.GetAsyncKeyState(win32con.VK_ESCAPE)
if i < 0:
print "escape!"
On 1/21/07, Murat Erten <murerten at gmail.com> wrote:
> Hi,
>
> I want to do something when user hits ESCAPE key from a frame with
> a panel. I tried accelerator table like this:
>
> I have a button with an ID = wx.ID_CANCEL
>
> frame.SetAcceleratorTable(wx.AcceleratorTable([
> (wx.ACCEL_NORMAL, wx.WXK_ESCAPE, wx.ID_CANCEL),
> ]))
>
> It didn't work. Then I tried catching key down event of the panel.
> That didn't work either.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
More information about the wxpython-users
mailing list