I made a tool that plays audio from youtube. I want it to pause when the spacebar is pressed. I do this by this piece of code:
win.bind('<space>',lambda event:funcPP(player, btnPP))
win
is my window, funcPP
is the play/pause function.
My problem is that I have also an Entry
in my window (for searching videos) and of course it is impractical if the video pauses everytime when I search a new video and press Spacebar. And the real problem is that, once I have clicked the Entry field, the focus stays there. It doesn't go away after clicking somewhere else! This sabotages my Spacebar shortcut.
Any tips how I can solve this?