[Python] Python turtle: check if a key is down

Discussão em 'Python' iniciado por Stack, Setembro 14, 2025.

  1. Stack

    Stack Membro Participativo

    I want to be able to detect if a key is currently down.

    I have found the turtle.onkey and turtle.onkeypress functions, however these don't work for me for two reasons:

    1. they are only triggered when the key is pressed or released.
    2. they call a function when you run them.

    I want a boolean that is True if the key is held down, or False if the key is not held down.

    Continue reading...

Compartilhe esta Página