Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pyonekeymouse/tests.py
blob: 2a42712a982b013a058f4d72d2a5ed3e712bf7ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python
from pymouse import PyMouse
import random, time

m = PyMouse()
try:
	size = m.screen_size()
	print "size: %s" % (str(size))

	pos = (random.randint(0, size[0]), random.randint(0, size[1]))
except:
	pos = (random.randint(0, 250), random.randint(0, 250))

print "Position: %s" % (str(pos))

print 'move'
m.move(pos[0], pos[1])

time.sleep(2)

print 'click left'
m.click(pos[0], pos[1], 1)

time.sleep(2)

print 'click right'
m.click(pos[0], pos[1], 2)

time.sleep(2)

print 'click middle'
m.click(pos[0], pos[1], 3)