how to capture the right click event using getMouse()

Posted by Leyond on Stack Overflow See other posts from Stack Overflow or by Leyond
Published on 2010-12-23T04:46:46Z Indexed on 2010/12/23 4:54 UTC
Read the original article Hit count: 212

Filed under:
|

I am trying to use graphics.py to write a user graphics interface. The problem is that how can I capture the right click event? It seems that the function getMouse() could just returns where the mouse was left-clicked as a Point object.

    from graphics import *
    def main():
        win = GraphWin("My Circle", 100, 100)
        c = Circle(Point(50,50), 10)
        c.draw(win)
        win.getMouse() # pause for click in window
        win.close()
     main()

I want to know how can I capture the right-click event in the window, thanks.

© Stack Overflow or respective owner

Related posts about python

Related posts about graphics