I'm not too sure how I'd explain it in the title, but I want to bind a key in Tkinter and not have it work if the key is being held down.
For example, root.bind("<space>", doaction) I'm trying to run doaction only when the spacebar is clicked and not held down. Is there any way to do this? I've tried KeyRelease too.
There is not much you can do. With respect to keyboard keys, you can bind on <KeyPress> and <KeyRelease>. If you want more, you'll have to set global variables and/or timers that are set or reset on one of those, and then checked on the other.
The problem is that on some systems, keyboards may send a sequence of press/release pairs while holding a key, while other systems may send just a single press and release. There's no good way to abstract that out since it may happen at the hardware level.
How to bind only keypresses and not when key is held down in Tkinter