टिंकर इवेंट्स का उपयोग आम तौर पर एक इंटरफ़ेस प्रदान करने के लिए किया जाता है जो उपयोगकर्ता और एप्लिकेशन लॉजिक के बीच एक सेतु के रूप में काम करता है। हम इसे और अधिक इंटरैक्टिव और कार्यात्मक बनाने के लिए किसी भी टिंकर एप्लिकेशन में ईवेंट का उपयोग कर सकते हैं। इवेंट जैसे <कुंजी दबाएं> और
उदाहरण
इस उदाहरण में, हम एक स्क्रिप्ट बनाएंगे जो स्क्रीन पर कुछ संदेश दिखाएगी जब भी हम कोई कुंजी दबाएंगे। जब हम एक ही कुंजी छोड़ते हैं तो संदेश गायब हो जाता है।
# Import the Required libraries
from tkinter import *
# Create an instance of tkinter frame or window
win= Tk()
# Set the size of the window
win.geometry("700x350")
# Define a function to display the message
def key_press(e):
label.config(text="Welcome to TutorialsPoint")
def key_released(e):
label.config(text="Press any Key...")
# Create a label widget to add some text
label= Label(win, text= "", font= ('Helvetica 17 bold'))
label.pack(pady= 50)
# Bind the Mouse button event
win.bind('<KeyPress>',key_press)
win.bind('<KeyRelease>',key_released )
win.mainloop() आउटपुट
उपरोक्त कोड को चलाने पर एक लेबल वाली विंडो प्रदर्शित होगी।

जब आप कीबोर्ड से कोई कुंजी दबाते हैं, तो यह स्क्रीन पर कुछ संदेश प्रदर्शित करेगा। साथ ही, जब भी आप कुंजी को हटाएंगे, संदेश अपडेट हो जाएगा।
