Move Canvas Shapes With Arrow Keys - Python Tkinter GUI Tutorial #69

preview_player
Показать описание
In this video I'll show you how to move objects on a Tkinter Canvas using the Arrow Keys on your keyboard.

It's fairly easy to bind keyboard events with Tkinter. In this video we'll look at binding arrow keys, but also regular letters on the keyboard as well.

Once we bind the events to a specific function in our TKinter program, we can then use the .move() function to move our canvas object using x and y coordinates that we'll define.
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:

Codemycom
Автор

Please keep making videos.
thank you

shubhamdeodhare
Автор

How do you make a object move with Wasd?

paths
Автор

Thaaaanks man but i have one question.
is there a way to make the mouvement not lagging, like when you press the button it instantly go full speed without the 1sec of slow ?
thank for you video again, helped me a lot

LouLeym
Автор

Hi, is there a way to get my object to stop moving once it has hot one side of my canvas? Right now it just goes off the screen.

xanderward
Автор

Any way to make it so that the object moves infinitely in that direction? I tried using a forever loop, but it didn't work properly.

senorslap
Автор

how do i move a line (only one extrem)?

pochotom
Автор

How hard would it to be, left and right select the object and up and down move it ? If you had say multiple shapes to move

Petergams
Автор

instead of using keyboard characters :
you can do this

def pressing(event):
x=0
y=0
if event.keysym=="Up":
x=0
y=-10
elif event.keysym=="Down":
x=0
y=10
elif event.keysym=="Left":
x=-10
y=0
elif event.keysym=="Right":
x=10
y=0
my_canvas.move(my_rectangle, x, y)

rajaryan
Автор

best tutorial ever please put a Vedio how to make a snake game in tkinter please

aparnapoppet
Автор

plz make a video how to rotate the object using canvas in python

Shubh
Автор

when i do this, it is able to move repeatedly to the left or downwards, however, the continuous motion doesn't work when pressing up or right. do you know why? (i am using WASD)

campanion
Автор

is it possible to make it so if it touches something it goes back to the beginning?

kevlar
Автор

Can i move a window having a label in it with Motion event??please

shehab
Автор

can you grab with a mouse and move it around in the canvas, and can you do that with many objects? i am thinking in the context of a card game to be honest.? thanks

bitbudsupport
Автор

Anyone Balloon, Meter, popup menu, std button & box used of tkinter

pavankushwaha
Автор

This guy actually looks like he's gonna break bad

sauravramesh
Автор

Knowing you don't know the classic WASD, you are not fond of gaming.

Hex-Scholar
join shbcf.ru