def doKey(e):
	print(e.widget.get("1.0","end"))
root= Tk()
root.title('yada')
txta = Text(root, width=40, height=10)
txta.bind("<Key>", doKey)
txta.pack(side=LEFT)
root.mainloop()

Pressing a key in this text area will always output the string prior to your pressing the key. Am I missing something?

Ok, well, what I ended up doing was just concatenating event.char to the end of widget.get(). If anyone has a better idea, please fill me.

hi,
i think you almost got it, here's what I have:

from Tkinter import *
def doKey(e):
	print(e.widget.get( 1.0, END + '-1c' ) + e.char )
root= Tk()
root.title('yada')
txta = Text(root, width=40, height=10)
txta.bind("<Key>", doKey)
txta.pack(side=LEFT)
root.mainloop()

Btw, that kind of behaviour is just what I need for my project, sooo thanks a lot for that dude :) hope this helps :)

def doKey(e):
	print(e.widget.get("1.0","end"))
root= Tk()
root.title('yada')
txta = Text(root, width=40, height=10)
txta.bind("<Key>", doKey)
txta.pack(side=LEFT)
root.mainloop()

Pressing a key in this text area will always output the string prior to your pressing the key. Am I missing something?

You could use txta.bind("<KeyRelease>", doKey)

This question has already been answered. Start a new discussion instead.