Jan-31-2018, 07:23 AM
(Jan-31-2018, 06:50 AM)lollo Wrote: Maybe with a delay?Or maybe by setting a variable and catching the release of the v key. See if this works
from tkinter import * CVPRESS = False def foo(event): global CVPRESS CVPRESS = True def bar(event): global CVPRESS if not CVPRESS: return CVPRESS = False print('bar() was called') root = Tk() T = Text(root, height=10, width=30) T.pack() T.bind('<Control-v>', foo) T.bind('<KeyRelease-v>', bar) T.insert(END, "Just a text Widget\nwith 2 lines\n") mainloop()