JS: Expose button event type in gui/widget button callback --nobuild

This commit is contained in:
WillyJL
2025-07-22 15:03:15 +02:00
parent 0e3e1b352b
commit a934c70a00
5 changed files with 65 additions and 16 deletions

View File

@@ -137,8 +137,8 @@ eventLoop.subscribe(gui.viewDispatcher.navigation, function (_sub, _, gui, views
}, gui, views, eventLoop);
// go to the demo chooser screen when the right key is pressed on the widget screen
eventLoop.subscribe(views.stopwatchWidget.button, function (_sub, buttonId, gui, views) {
if (buttonId === "right")
eventLoop.subscribe(views.stopwatchWidget.button, function (_sub, buttonEvent, gui, views) {
if (buttonEvent.key === "right" && buttonEvent.type === "short")
gui.viewDispatcher.switchTo(views.demos);
}, gui, views);