Skip to content

Commit 3f03a75

Browse files
LagoLunaticencounter
authored andcommitted
Add space as alternative to enter hotkey
This is for consistency with egui's builtint enter/space hotkey for interacting with the focused widget.
1 parent 4fb64a3 commit 3f03a75

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

objdiff-gui/src/hotkeys.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ pub fn enter_pressed(ctx: &Context) -> bool {
88
if any_widget_focused(ctx) {
99
return false;
1010
}
11-
ctx.input_mut(|i| i.key_pressed(Key::Enter) || i.pointer.button_pressed(PointerButton::Extra2))
11+
ctx.input_mut(|i| {
12+
i.key_pressed(Key::Enter)
13+
|| i.key_pressed(Key::Space)
14+
|| i.pointer.button_pressed(PointerButton::Extra2)
15+
})
1216
}
1317

1418
pub fn back_pressed(ctx: &Context) -> bool {

0 commit comments

Comments
 (0)