mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-11 22:50:08 +00:00
commit selected entity creation by hitting enter
This commit is contained in:
@@ -67,6 +67,7 @@ use crate::{
|
||||
settings::{scene::SceneSettings, Settings},
|
||||
ui_scene::{commands::graph::AddWidgetCommand, UiScene},
|
||||
};
|
||||
use fyrox::gui::message::KeyCode;
|
||||
use std::{collections::BTreeMap, path::PathBuf};
|
||||
|
||||
#[derive(Default, Eq, PartialEq, Copy, Clone, Debug)]
|
||||
@@ -517,6 +518,11 @@ impl EntityCreator {
|
||||
message.data_from(self.recent_list)
|
||||
{
|
||||
self.on_recent_item_selected(ui, selection)
|
||||
} else if let Some(WidgetMessage::KeyDown(code)) = message.data() {
|
||||
// Commit selected entity creation by hitting Enter.
|
||||
if ui.is_node_child_of(message.destination(), self.window) && *code == KeyCode::Enter {
|
||||
return self.on_create_clicked(constructors, ui, ctx, settings, scene_path);
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user