aboutsummaryrefslogtreecommitdiffstats
path: root/web-project/src
diff options
context:
space:
mode:
Diffstat (limited to 'web-project/src')
-rw-r--r--web-project/src/solo_tool_web.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/web-project/src/solo_tool_web.py b/web-project/src/solo_tool_web.py
index b014061..3c68585 100644
--- a/web-project/src/solo_tool_web.py
+++ b/web-project/src/solo_tool_web.py
@@ -31,6 +31,18 @@ sessions = {}
sessionManager = None
midiPedal = ActitionController()
+def makeKeyboardHandler(st: SoloTool):
+ def handleKey(e: events.KeyEventArguments):
+ if e.action.keyup and not e.action.repeat:
+ if e.key.enter:
+ if st.playing: st.pause()
+ else: st.play()
+ elif e.key.shift:
+ st.jump()
+ elif e.key.arrow_left:
+ st.position = 0.0
+ return handleKey
+
@ui.page('/{sessionId}')
def sessionPage(sessionId: str):
if sessionId not in sessions:
@@ -43,6 +55,7 @@ def sessionPage(sessionId: str):
st = sessions[sessionId]
midiPedal.setSoloTool(st)
+ ui.keyboard(on_key=makeKeyboardHandler(st))
# Manage songs dialog
with ui.dialog() as manageSongsDialog: