mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 07:25:47 +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
|
// Handle nav keys
|
||||||
#[allow(clippy::collapsible_if)]
|
#[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];
|
let choice = &self.choices[self.current_idx];
|
||||||
if choice.active {
|
if choice.active {
|
||||||
output.outcome = Outcome::Clicked(choice.label.clone());
|
output.outcome = Outcome::Clicked(choice.label.clone());
|
||||||
|
Loading…
Reference in New Issue
Block a user