1

I have a bind event for when a key is pressed to trigger a function but how would I see if the key pressed was the enter key? Here is my code:

This did not work. What would I replace the word enter with to check if the enter key is pressed:

def record(self,event):
    x = event.char
    if x == "Enter":
        print("Enter")

1 Answers1

0

You can check using keysym:

if event.keysym == 'Return'
Padraic Cunningham
  • 168,988
  • 22
  • 228
  • 312