I created a gui in wxpython. I tried to use wx.EVT_KEY_DOWN. When I press a key, I want to know if the key changed the messageTxt (It was't a key such as right, shift, alt etc...). I prints the messageTxt before and after the evt.Skip() but it doen't changes, only in the second char i can see the last changes. Someone know how do I get the new messageTxt after the evt.Skip()? By that, I could compare the text before the skipping and after and get the result it there was a change. Here is some code that explaines the problem.
import wx
from wx.stc import StyledTextCtrl
def On_KeyDown(evt):
x, y = messageTxt.GetSelection()
# If something is selected, de-select it
if x != y:
messageTxt.SetEmptySelection(y)
else:
print("Before skipping", messageTxt.GetText())
evt.Skip()
print("After skipping", messageTxt.GetText())
app = wx.App()
frame = wx.Frame(None, -1, title='2', pos=(0, 0), size=(500, 500))
frame.Show(True)
messageTxt = StyledTextCtrl(frame, id=wx.ID_ANY, pos=(0, 0), size=(100 * 3, 100),
style=wx.TE_MULTILINE, name="File")
messageTxt.Bind(wx.EVT_KEY_DOWN, On_KeyDown)
app.SetTopWindow(frame)
app.MainLoop()