Skip to content
This repository was archived by the owner on Nov 11, 2025. It is now read-only.

Commit d404738

Browse files
committed
receiver: pause playback with space key
1 parent 45b6196 commit d404738

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

receiver/ui/main.slint

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,6 @@ export component MainWindow inherits Window {
496496

497497
// TODO: subtitles
498498

499-
// TODO: keypress handling
500499
TouchArea {
501500
width: 100%;
502501
height: 100%;
@@ -505,8 +504,19 @@ export component MainWindow inherits Window {
505504

506505
mouse-cursor: self.visible && !playback-control.visible ? none : default;
507506

507+
FocusScope {
508+
key-pressed(event) => {
509+
if (event.text == Key.Space) {
510+
resume-or-pause();
511+
return accept;
512+
}
513+
// TODO: seeking with arrow keys
514+
reject
515+
}
516+
}
517+
508518
pointer-event(pe) => {
509-
if pe.kind == PointerEventKind.move {
519+
if (pe.kind == PointerEventKind.move) {
510520
playback-control.show();
511521
}
512522
}

0 commit comments

Comments
 (0)