Functionality!
This commit is contained in:
15
patapon.py
15
patapon.py
@@ -4,7 +4,11 @@ import subprocess
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
def ydotool(key):
|
def ydotool(key):
|
||||||
pass
|
subprocess.run([
|
||||||
|
"ydotool",
|
||||||
|
"type",
|
||||||
|
str(key)
|
||||||
|
])
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# A list of all possible songs, expressed as their cardinal directions
|
# A list of all possible songs, expressed as their cardinal directions
|
||||||
@@ -72,8 +76,13 @@ def main():
|
|||||||
while time.perf_counter() < synctime + lastbeat:
|
while time.perf_counter() < synctime + lastbeat:
|
||||||
pass
|
pass
|
||||||
lastbeat += beat_interval
|
lastbeat += beat_interval
|
||||||
ydotool(key)
|
button = keymapping.get(key, '-')
|
||||||
print(drummapping.get(key, '-'))
|
if button != '-':
|
||||||
|
ydotool(button)
|
||||||
|
print(drummapping.get(key, '-'), end="", flush=True)
|
||||||
|
else:
|
||||||
|
print(" ", end="", flush=True)
|
||||||
remaining_iterations -= 1
|
remaining_iterations -= 1
|
||||||
|
print(f"~ ({remaining_iterations} remaining)")
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
Reference in New Issue
Block a user