Without digging into code, I seem to recall that the ctrl+C is intercepted at a higher level by the accelerator table, so grabbing it in your local key handler won’t do anything. Try adding a Copy method on your derived text control class and see if it gets there:
···
def Copy(self):
print("Copy called.")
super().Copy() # Comment this out to disable actually copying anything.
On Wednesday, December 6, 2017 at 12:26:54 PM UTC-8, Rel Guzman wrote:
I’ve been trying to figure out how to make a “RichTextCtrl” do nothing when someone presses CTRL+C.
I import it with
import wx.richtext as rt
And I know how to it with “wx.TextCtr”, but it doesn’t work with “rt.RichTextCtrl”.
def OnKeyDown(self, event):
code = event.GetKeyCode()
# If Ctrl+C is pressed...
if event.ControlDown() and code == 67:
return
event.Skip()