Sorry, if this is a duplicate or obvious question. So I simply wrote this:
import tkinter as tk
root = tk.Tk()
def on_key_pressed(e: tk.Event):
print(text_field.get())
text_field = tk.Entry()
text_field.pack()
text_field.bind("<KeyPress>", on_key_pressed)
When I press key, it outputs like a previous typed string and not considering the key that has just been pressed. I guess maybe this is because the event keyPress happens too fast, and Entry didn't register this new change yet.
Am I right, or what will be a better explanation of this?