https://www.pythonmorsels.com/p/2j8vb/
I'd like to bind 3 keys to 3 buttons but it does'nt work
9 messages ยท Page 1 of 1 (latest)
https://www.pythonmorsels.com/p/2j8vb/
I'd like to bind 3 keys to 3 buttons but it does'nt work
@stray slate
Remember to:
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
this prior explanation i gave is likely relevant here #user-interfaces message , but basically your widgets, btn_previous/pause/next, can't receive keyboard events unless they have keyboard focus, and only certain widgets automatically get keyboard focus when you click on them, like Text or Entry
you should bind to the top-level window instead, i.e. Tk() or Toplevel()
for example: ```py
from tkinter import Tk
app = Tk()
app.geometry("300x200")
app.bind("<KeyPress>", lambda e: print(e.keysym))
app.mainloop()```
Doesn't work
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.
๐ Tkinter bind to button