Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyl3r committed Aug 31, 2021
0 parents commit 05b8845
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Project exclude paths
/venv/
14 changes: 14 additions & 0 deletions ModuleParameter.py
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()
44 changes: 44 additions & 0 deletions main.py
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()

0 comments on commit 05b8845

Please sign in to comment.