Skip to content
Advertisement

Tag: key-bindings

How to remove a keybind after it has done its job

I created a keybind, and want to delete it after it is activated. How do I do this? I have tried this in my code: However, this does not work, as Python displays an error message stating that deletecommand() takes 2 positional arguments but 3 were given, when I only gave two arguments. I also tried root.delete(‘<Key>’, testing), but this

Keybind that binds to every key in tkinter

I am creating an interactive game with Python, and I am trying to make an introduction with the instruction “Press any key to continue.” I am having some difficulty with binding all the keys to a single action. I have tried binding to ‘<Any>’, but it displays an error message. As mentioned before, the ‘<Any>’ keybind results in an error

Advertisement