From 8147f4909365f944f975dc7bbe3e0b286b3daeae Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Fri, 10 Sep 2021 13:52:55 -0700 Subject: [PATCH] Work around widgetry focus problem -- allow space or enter to choose a menu entry. Proper fix started and problem described more in #739. --- widgetry/src/widgets/menu.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgetry/src/widgets/menu.rs b/widgetry/src/widgets/menu.rs index 601ba3d53e..d11cca2397 100644 --- a/widgetry/src/widgets/menu.rs +++ b/widgetry/src/widgets/menu.rs @@ -153,7 +153,7 @@ impl WidgetImpl for Menu { // Handle nav keys #[allow(clippy::collapsible_if)] - if ctx.input.pressed(Key::Enter) { + if ctx.input.pressed(Key::Enter) || ctx.input.pressed(Key::Space) { let choice = &self.choices[self.current_idx]; if choice.active { output.outcome = Outcome::Clicked(choice.label.clone());