For instance in this code:
def check(event):
if event.key == "a":
function()
add_key_down_handler(check)
If the key "a" is clicked again after this, function()
should not run.
The way I tried to solve this was to do the following:
def check(event):
if event.key == "a":
function()
remove_key_down_handler(check)
add_key_down_handler(check)