Reputation: 7413
right now I have an implementation where I'm using my middle mouse button for two operations:
What I wish to do is:
It is just like how it is implemented in MS Word or Chrome browser.
Help!
Upvotes: 0
Views: 1352
Reputation: 5394
Here's a quick simple thing of what I believe you're after.
import tkinter as tk
root = tk.Tk()
pressed = False
def onClick(event):
global pressed
pressed = not pressed # toggle pressed when clicked
print('Pressed')
def onMove(event):
if pressed:
print(event.x, event.y)
root.bind('<Button-2>', onClick)
root.bind('<Motion>', onMove)
root.mainloop()
Upvotes: 2