import time
import autopy as ap
from autopy.mouse import LEFT_BUTTON
from autopy.mouse import RIGHT_BUTTON
def rightClick():
ap.mouse.click(RIGHT_BUTTON)
time.sleep(.1)
print "# right click"
def leftClick():
ap.mouse.click(LEFT_BUTTON)
time.sleep(.1)
print "# left click"
def rightDown():
ap.mouse.toggle(True, RIGHT_BUTTON)
time.sleep(.1)
print '# left down'
def rightUp():
ap.mouse.toggle(False, RIGHT_BUTTON)
time.sleep(.1)
print '# left release'
def leftDown():
ap.mouse.toggle(True, LEFT_BUTTON)
time.sleep(.1)
print '# left down'
def leftUp():
ap.mouse.toggle(False, LEFT_BUTTON)
time.sleep(.1)
print '# left release'
#############################################################################
if __name__ == "__main__":
time.sleep(1)
leftClick()
leftDown()
# ap.mouse.RIGHT_BUTTON()
leftUp()
time.sleep(3)
rightClick()
rightDown()
rightUp()