-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtracker.py
More file actions
34 lines (25 loc) · 880 Bytes
/
tracker.py
File metadata and controls
34 lines (25 loc) · 880 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
import mouse, time, keyboard, pickle
from threading import Thread
def start_tracking(config, debugger=print):
count = 0
while config.run:
time.sleep(0.1)
position = mouse.get_position()
config.mouse_points.append((config.get_time(), position))
count += 1
if count == 12:
debugger("Mouse Coordinates : " + str((config.get_time(), position)))
count = 0
config.save()
def end_tracking(config, event, debugger=print):
config.run = False
config.continue_recording = False
def end_gui(config):
config.run = False
config.continue_recording = False
def previous_slide(config, event, debugger=print):
config.keyboard_points.append((config.get_time(), 'LEFT'))
debugger("Keyboard Event: PREVIOUS SLIDE")
def next_slide(config, event, debugger=print):
config.keyboard_points.append((config.get_time(), 'RIGHT'))
debugger("Keyboard Event: NEXT SLIDE")