From 89b00907f6620580c1406c67cdef48f4dc72bbff Mon Sep 17 00:00:00 2001 From: Jacob Babor Date: Thu, 30 Jan 2025 03:01:47 -0600 Subject: [PATCH] Functionality! --- patapon.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/patapon.py b/patapon.py index 4e307a0..7497b7d 100755 --- a/patapon.py +++ b/patapon.py @@ -4,7 +4,11 @@ import subprocess import time def ydotool(key): - pass + subprocess.run([ + "ydotool", + "type", + str(key) + ]) def main(): # A list of all possible songs, expressed as their cardinal directions @@ -72,8 +76,13 @@ def main(): while time.perf_counter() < synctime + lastbeat: pass lastbeat += beat_interval - ydotool(key) - print(drummapping.get(key, '-')) + button = keymapping.get(key, '-') + if button != '-': + ydotool(button) + print(drummapping.get(key, '-'), end="", flush=True) + else: + print(" ", end="", flush=True) remaining_iterations -= 1 + print(f"~ ({remaining_iterations} remaining)") main()