0
votes

I'm building an application in python using tkinter. Have put an KeyPress eventListener (from tkinter), the event gets triggered as it should, but when checking the keycode/keysym of the event things don't go as expected:

window.bind("<KeyPress>", onkeydown)
def onkeydown(e): 
    print(e.keysym is "Return")
    print(e.keycode is 13)
    print(e.keycode, e.keysym)
Console output:
False
False
13 Return

this is a serious thread, can anyone explain whats going on here?