Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_mouse_xy.py
- from Tkinter import *
- root = Tk()
- def key(event):
- root.event_generate('<Motion>', warp=True, x=50, y=50)
- def motion(event):
- print('x = {}, y = {}'.format(event.x, event.y))
- root.bind('<Key>', key)
- root.bind('<Motion>', motion)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement