-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanother_one.py
More file actions
36 lines (31 loc) · 874 Bytes
/
another_one.py
File metadata and controls
36 lines (31 loc) · 874 Bytes
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
33
34
35
36
#!python2
import pyHook
import pythoncom
import pyglet
import time
import ctypes
last_click_time = 0
def onclick(event):
if event.Message == pyHook.HookConstants.WM_MBUTTONDOWN:
bless_up.play()
time.sleep(2)
ctypes.windll.user32.PostQuitMessage(0)
else:
print event.Position
t = time.time()
global last_click_time
print t, last_click_time
if t > last_click_time + 1.75:
dj.play()
else:
khaled.play()
last_click_time = t
return True
dj = pyglet.resource.media('another_one_loud.wav', streaming=False)
khaled = pyglet.resource.media('and_another_one_loud.wav', streaming=False)
bless_up = pyglet.resource.media('bless_up.wav')
hm = pyHook.HookManager()
hm.SubscribeMouseAllButtonsDown(onclick)
hm.HookMouse()
pythoncom.PumpMessages()
hm.UnhookMouse()