Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

tkinter how to connect keyboard key to button

import tkinter as tk
root = tk.Tk()

btn = tk.Button(root, "Press me")

def do_something():
  pass

btn.bind('<Return>', do_something)
 
PREVIOUS NEXT
Tagged: #tkinter #connect #keyboard #key #button
ADD COMMENT
Topic
Name
7+8 =