Rework FileDialog shortcuts

This commit is contained in:
kobewi
2025-10-09 22:31:55 +02:00
parent 295e465fe4
commit 263a2bdec6
6 changed files with 97 additions and 63 deletions

View File

@@ -85,6 +85,17 @@ String Shortcut::get_as_text() const {
return "None";
}
Ref<Shortcut> Shortcut::make_from_action(const StringName &p_action) {
Ref<InputEventAction> event;
event.instantiate();
event->set_action(p_action);
Ref<Shortcut> shortcut;
shortcut.instantiate();
shortcut->set_events({ event });
return shortcut;
}
bool Shortcut::has_valid_event() const {
// Tests if there is ANY input event which is valid.
for (int i = 0; i < events.size(); i++) {