From a57dafd2683623732d87f3c97e94c09a2f87c7fd Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Sun, 4 Jan 2026 10:07:16 +0100 Subject: Improve nicegui keyboard shortcuts --- web-project/src/solo_tool_web.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/web-project/src/solo_tool_web.py b/web-project/src/solo_tool_web.py index 7b3d740..9c65a87 100644 --- a/web-project/src/solo_tool_web.py +++ b/web-project/src/solo_tool_web.py @@ -36,15 +36,22 @@ midiPedal = ActitionController() recorder = None def makeKeyboardHandler(st: SoloTool): + restartOrPrevious = handlers.restartOrPreviousSong(st, 0.01) + nextSong = handlers.songRelative(st, 1) + playPause = handlers.playPause(st) + positionToKeyPoint = handlers.positionToKeyPoint(st) 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() + if e.key.control: + playPause() elif e.key.shift: st.jump() elif e.key.arrow_left: - st.position = 0.0 + restartOrPrevious() + elif e.key.arrow_right: + nextSong() + elif e.key.arrow_down: + positionToKeyPoint() return handleKey @ui.page('/{sessionId}') -- cgit v1.2.3