From 461605810324b3d075dd6f05bce3fb43f4d8bb56 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Thu, 28 Nov 2024 18:16:19 -0500 Subject: [PATCH] Add space as alternative to enter hotkey This is for consistency with egui's builtint enter/space hotkey for interacting with the focused widget. --- objdiff-gui/src/hotkeys.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/objdiff-gui/src/hotkeys.rs b/objdiff-gui/src/hotkeys.rs index d23529f..23151c0 100644 --- a/objdiff-gui/src/hotkeys.rs +++ b/objdiff-gui/src/hotkeys.rs @@ -8,7 +8,11 @@ pub fn enter_pressed(ctx: &Context) -> bool { if any_widget_focused(ctx) { return false; } - ctx.input_mut(|i| i.key_pressed(Key::Enter) || i.pointer.button_pressed(PointerButton::Extra2)) + ctx.input_mut(|i| { + i.key_pressed(Key::Enter) + || i.key_pressed(Key::Space) + || i.pointer.button_pressed(PointerButton::Extra2) + }) } pub fn back_pressed(ctx: &Context) -> bool {