I've come across a bug that I can't seem to understand. I have a tkinter Text widget that has a bind that triggers on text modification. For some reason this event gets triggered when I use the key combination even though it shouldn't, as it doesn't modify the contents of the Text widget.
Here comes the weird part: this only (occurs with . I have made a simple program to demonstrate the problem. Other than special preassigned key combinations such as that actually modify the content, no other combination behaves like this.
Why does this occur for specifically? And how do I prevent it?
import tkinter as tk
root = tk.Tk()
txt = tk.Text(root)
txt.pack()
root.bind("<Control-u>", lambda e: print("doesn't trigger"))
root.bind("<Control-o>", lambda e: print("somehow triggers"))
txt.bind("<<Modified>>", lambda e: print("text got modified!")) # (keep in mind that this will only get triggered once)