Help: Can't read mouse button propperly

I can’t get this to work, what am I doing wrong?
I can print out the mouse button that is clicked, but I can not get that value to do something. It acts like it doesn’t exist even though it can print the value.


import rhinoscriptsyntax as rs
import System.Windows.Forms

total=30

for i in range(total):
    rs.Sleep(300)
    mb= System.Windows.Forms.Control.MouseButtons
    print i,"/",total," ",mb
    if mb=="Left":
        print "1"

I think you have to qualify the “Left” enumeration, instead of comparing to a string:

if mb==System.Windows.MouseButtons.Left:

edit: alternatively,

if str(mb)==“Left”: (if you’re not worried about type safety)

You made my day! Thanks!