Reputation: 3153
I have designed a file copy software in python with GUI in Wxpython. Now I want to bind Windows standard keyboard event "CTRL+V" to my application so that when any user presses "CTRL+V" then my application automaticaly copies that file to it destination.
Upvotes: 0
Views: 223
Reputation: 113930
use the Accelerator Table
def OnPaste(evt):
pass #do something
pasteID = wx.NewId()
aTable = wx.AcceleratorTable([(wx.ACCEL_CTRL, ord('V'), pasteID ),])
my_main_frame.SetAcceleratorTable(aTable)
my_main_frame.Bind(wx.EVT_MENU,OnPaste,pasteID )
Upvotes: 1