On Wed, Jun 20, 2012 at 8:48 AM, Andre Arpin <[email protected]> wrote:
> Milind Gupta <milind.gupta@...> writes:
>>
>> 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?
>>
> Try this
> ---------------------
> frame = wx.wxFrame( wx.NULL, wx.wxID_ANY, "Testing")
> frame:Show(true)
> frame:Connect(wx.wxID_ANY, wx.wxEVT_CHAR,
>    function(event)
>        print(event, event.KeyCode)
>    end)

Getting key events for a frame does not work in Linux, but you can on
a child panel (which you should always have in any case). To check for
Ctrl/Alt/Shift use wxKeyBoardEvent:Alt/Ctrl/ShiftDown().

Milind, perhaps you're looking for a wxAccelerator or even a menu item
with the accelerator attached, "E&xit\tCtrl-X" ?

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to