-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 05b8845
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Project exclude paths | ||
/venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class ModuleParameter: | ||
parameterName = "" | ||
parameterValue = "" | ||
|
||
def __init__(self, name): | ||
self.parameterName = name | ||
f = open("/sys/module/leetmouse/parameters/" + self.parameterName, "r") | ||
self.parameterValue = f.read() | ||
|
||
def set(self, val): | ||
self.parameterValue = val | ||
f = open("/sys/module/leetmouse/parameters/" + self.parameterName, "w") | ||
f.write(self.parameterValue) | ||
f.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import PySimpleGUIQt as sg | ||
from ModuleParameter import ModuleParameter | ||
|
||
Parameters = { | ||
"Acceleration": ModuleParameter("Acceleration"), | ||
"Sensitivity": ModuleParameter("Sensitivity"), | ||
"Post Scale X": ModuleParameter("PostScaleX"), | ||
"Post Scale Y": ModuleParameter("PostScaleY"), | ||
"Pre Scale X": ModuleParameter("PreScaleX"), | ||
"Pre Scale Y": ModuleParameter("PreScaleY"), | ||
"Speed Cap": ModuleParameter("SpeedCap"), | ||
"Offset": ModuleParameter("Offset"), | ||
"Scrolls per Tick": ModuleParameter("ScrollsPerTick"), | ||
} | ||
|
||
UpdateParameter = ModuleParameter("update") | ||
|
||
layout = [ | ||
[sg.Text("leetmouse GUI")] | ||
] | ||
|
||
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()) | ||
|
||
UpdateParameter.set("1") | ||
|
||
if event == "OK" or event == sg.WIN_CLOSED: | ||
break | ||
|
||
|
||
|
||
window.close() |