From: Milind G. <mil...@gm...> - 2012-06-19 22:09:00
|
Thanks John for the quick reply. I changed the connect statement to : frame:Connect(ID_FRAME, wx.wxEVT_CHAR_HOOK, CharKeyEvent) That seems to be catching all keys except the alphabets and numbers. How do I catch those? Also how do I catch key combinations like Ctrl-X? Thanks, Milind On Tue, Jun 19, 2012 at 1:17 PM, John Labenski <jla...@gm...> wrote: > On Tue, Jun 19, 2012 at 2:11 PM, Milind Gupta <mil...@gm...> > wrote: > > Hi, > > I am trying to associate key events with a frame but it doesn't > seem > > to be working. I am doing this: > > > > frame:Connect(ID_FRAME, wx.wxEVT_CHAR, CharKeyEvent) > > You probably can't focus the frame if you have a window as a child for > the frame since it always gets the focus since it fills the client > area by default so it'd be hard to click on it or at least I couldn't > do it in MSW. > > Secondly, you need to either use the window style wxWANTS_CHARS for > wxEVT_CHAR to work or use wxEVT_CHAR_HOOK which is sent before > wxWidgets does any key handling, just be sure to call event:Skip(true) > if you want the wxKeyEvent handled normally. > > > I looked at the grid.wx.lua example also, how does the key combinations > > caught to call the menu event handlers? > > When you create a menu item; "&Open...\tCtrl+O", wxWidgets will add an > accelerator to intercept Ctrl+O and send the menu event and you won't > get a wxEVT_CHAR for it. Note that wxEVT_CHAR_HOOK will be sent > though. > > Regards, > John > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > wxlua-users mailing list > wxl...@li... > https://lists.sourceforge.net/lists/listinfo/wxlua-users > |