4 hdaps-pivot - read hdaps position and print it
7 # Copyright: 2008-2009 Evgeni Golov <sargentd@die-welt.net>
11 from time
import sleep
17 def pivot(count
=1000, verbose
=False):
18 calX
,calY
= readPosition(True)
19 print '(x,y) base: (%u,%u)' % (calX
, calY
)
20 for i
in range(0,count
):
21 posX
,posY
= readPosition()
22 print '(x,y) position: (%i,%i)' % (posX
-calX
, posY
-calY
)
24 print 'keyboard=%i mouse=%i' % (readKeyboardActivity(), readMouseActivity())
28 print 'hdaps-pivot from pyhdaps, version %s' % __version__
30 print '\t-c, --count <count>\tthe count of rounds it will print'
31 print '\t-v, --verbose\tprint also keyboard and mouse activity'
35 opts
, args
= getopt
.getopt(sys
.argv
[1:], "hc:v", ["help", "count=", "verbose"])
36 except getopt
.GetoptError
, err
:
43 if o
in ("-v", "--verbose"):
45 elif o
in ("-h", "--help"):
48 elif o
in ("-c", "--count"):
53 if __name__
== '__main__':