forked from Skyl3r/leetmouse-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
46 lines (34 loc) · 1.32 KB
/
main.py
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
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python3
import PySimpleGUIQt as sg
import os.path
from ModuleParameter import ModuleParameter
Parameters = {
"Scrolls per Tick": ModuleParameter("ScrollsPerTick"),
"Acceleration": ModuleParameter("Acceleration"),
"Sensitivity": ModuleParameter("Sensitivity"),
"Sensitivity Cap": ModuleParameter("SensitivityCap"),
"Speed Cap": ModuleParameter("SpeedCap"),
"Offset": ModuleParameter("Offset"),
"PostScaleX": ModuleParameter("PostScaleX"),
"PostScaleY": ModuleParameter("PostScaleY"),
"PreScaleX": ModuleParameter("PreScaleX"),
"PreScaleY": ModuleParameter("PreScaleY"),
}
# Special cases
UpdateParameter = ModuleParameter("update")
layout = [[sg.Text("LEETMOUSE")]]
for param in Parameters:
layout.append([sg.Text(param), sg.InputText(default_text=Parameters[param].parameterValue, key=Parameters[param].parameterName)])
layout.append([sg.Button("Update")])
window = sg.Window(title="leetmouse GUI", layout=layout)
while True:
event, values = window.read()
if event == "Update":
# Update parameters
for param in Parameters:
Parameters[param].set(window[Parameters[param].parameterName].get())
# Set update flag so LEETMOUSE knows to read changes
UpdateParameter.set("1")
if event == sg.WIN_CLOSED:
break
window.close()