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
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import win32api, win32con, time, win32ui, pyHook, pythoncom
from Tkinter import *
fenetre = Tk()
tab = []
def onclick(event):
tab.append(event.Position);
print(tab)
return True
def callfunc():
fenetre.iconify()
b = Button(fenetre , text="PICK", command=callfunc)
b.pack()
fenetre.mainloop()
hm = pyHook.HookManager()
hm.SubscribeMouseAllButtonsDown(onclick)
hm.HookMouse()
pythoncom.PumpMessages()
hm.UnhookMouse() |
Partager