mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 23:15:24 +03:00
Work around widgetry focus problem -- allow space or enter to choose a menu entry. Proper fix started and problem described more in #739.
This commit is contained in:
parent
50b8c533bf
commit
8147f49093
@ -153,7 +153,7 @@ impl<T: 'static> WidgetImpl for Menu<T> {
|
||||
|
||||
// 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());
|
||||
|
Loading…
Reference in New Issue
Block a user