Debug keyboard mode: log key presses

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 20:17:12 -04:00
parent 1762500108
commit 0d340dad30
+6 -2
View File
@@ -353,11 +353,15 @@ class LiveTUI:
self.log(f"Octave ↓ {self.engine._keyboard_octave}", 2)
elif 32 <= ch < 127:
key = chr(ch).lower()
if self.engine.keyboard_note(key, on=True):
played = self.engine.keyboard_note(key, on=True)
if played:
self.log(f" key:{key}", 2)
def _off(k=key):
time.sleep(0.2)
time.sleep(0.25)
self.engine.keyboard_note(k, on=False)
threading.Thread(target=_off, daemon=True).start()
else:
self.log(f" unmapped:{key}", 3)
continue
if ch == 10 or ch == 13: