About 2,790,000 results
Open links in new tab
  1. Python, moving object with arrow keys - Stack Overflow

    Feb 27, 2019 · I need to create an object (specifically oval) using Python that moves on its own or enables the user to move the object with arrow keys. I need to do so using these two def. if m==1: can.move (id, 0,-5) elif m==3: can.move (id,0, 5) elif m==0: can.move (id,5, 0) else: can.move (id, - 5,0) can.after (50, motion) global m. if event.keysym=='Up':

  2. How to move turtles in Python 3 with arrow keys - Stack Overflow

    Jul 29, 2022 · If you're looking for handling multiple keypresses at once, How to bind several key presses together in turtle graphics? might help.

  3. python - move object until another key is pressed - Stack Overflow

    May 27, 2021 · I suggest the use of .after() method to keep moving your rectangle until a new key is encountered. You can make use of .after_cancel to remove the scheduled job if a new key is pressed.

  4. How To Move The Player With Keyboard Keys Using Python's …

    To do this, you'll need to bind the function turn_left () to the left arrow key on your keyboard. You can create this key binding using the onkeypress () function in the turtle module. This is a function, or more accurately a method, that belongs to the Screen () object.

  5. Python tkinter moving objects using move () on Canvas - Plus2net

    Moving rectangle on a Tkinter Canvas by using four buttons or directional arrow keys

  6. Creating Movable Objects With Turtle And Your Keyboard

    Jan 18, 2025 · In this tutorial, you'll learn how to make your Turtle move when you press a key on the keyboard. This allows you to make your program interactive. Whether you want to write an animation that needs some input from the user, or you're writing a game, you'll need to be able to link certain actions to certain keypresses. python.

  7. Moving an object in PyGame - Python - GeeksforGeeks

    Apr 11, 2025 · We will see how to move an object such that it moves horizontally when pressing the right arrow key or left arrow key on the keyboard and it moves vertically when pressing up arrow key or down arrow key. We’ll create a game window, draw an object and update its position based on user input. Change in Co-ordinates for respective keys pressed:

  8. How to Bind Keys in Python 3! (Using the Turtle Module)

    May 26, 2023 · In this video, I'll explain how to bind functions to keys using the Python Turtle module.

  9. Move objects in pygame with arrow keys in Python - CodeSpeedy

    Here I will show you how to move objects in pygame with arrow keys in Python. The following code gives a description of how to move an object with keypress.

  10. How to move in entries using the arrow keys by applying ... - Python

    Apr 6, 2022 · I have some entries in tkinter. currently, I need to move the cursor to each entry and click it to select it. I am looking to do this using the arrow keys. I saw we can use bind_class to select all th

  11. Some results have been removed
Refresh