summaryrefslogtreecommitdiff
path: root/hid/patch.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-10-05 02:42:06 +0300
committerDevaev Maxim <[email protected]>2019-10-05 02:42:06 +0300
commitda660d02cd9184f31f47bec3edb3a600608b45d5 (patch)
treee079c5a144259a04ac7ea53aaf69861c640bbf6c /hid/patch.py
parentf5bbfeb8b523ddb9fe1277f2b06deb3970e51105 (diff)
arduino hid: fixed mouse movement on windows
Diffstat (limited to 'hid/patch.py')
-rw-r--r--hid/patch.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/hid/patch.py b/hid/patch.py
new file mode 100644
index 00000000..24ba2123
--- /dev/null
+++ b/hid/patch.py
@@ -0,0 +1,18 @@
+from os.path import join
+from os.path import exists
+
+Import("env")
+
+
+# =====
+env_path = join(env["PROJECTLIBDEPS_DIR"], env["PIOENV"])
+flag_path = join(env_path, ".patched")
+
+if not exists(flag_path):
+ env.Execute(f"patch -p1 -d {join(env_path, 'HID-Project_ID523')} < {join('patches', 'absmouse.patch')}")
+
+ def touch_flag(*_, **__) -> None:
+ with open(flag_path, "w") as flag_file:
+ pass
+
+ env.Execute(touch_flag)