summaryrefslogtreecommitdiffstats
path: root/editor/plugins/animation_library_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/animation_library_editor.cpp')
-rw-r--r--editor/plugins/animation_library_editor.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/editor/plugins/animation_library_editor.cpp b/editor/plugins/animation_library_editor.cpp
index afe7ea83d8..b07db993ba 100644
--- a/editor/plugins/animation_library_editor.cpp
+++ b/editor/plugins/animation_library_editor.cpp
@@ -781,6 +781,27 @@ void AnimationLibraryEditor::_update_editor(Object *p_mixer) {
emit_signal("update_editor", p_mixer);
}
+void AnimationLibraryEditor::shortcut_input(const Ref<InputEvent> &p_event) {
+ const Ref<InputEventKey> k = p_event;
+ if (k.is_valid() && k->is_pressed()) {
+ bool handled = false;
+
+ if (ED_IS_SHORTCUT("ui_undo", p_event)) {
+ EditorNode::get_singleton()->undo();
+ handled = true;
+ }
+
+ if (ED_IS_SHORTCUT("ui_redo", p_event)) {
+ EditorNode::get_singleton()->redo();
+ handled = true;
+ }
+
+ if (handled) {
+ set_input_as_handled();
+ }
+ }
+}
+
void AnimationLibraryEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update_editor", "mixer"), &AnimationLibraryEditor::_update_editor);
ADD_SIGNAL(MethodInfo("update_editor"));
@@ -788,6 +809,7 @@ void AnimationLibraryEditor::_bind_methods() {
AnimationLibraryEditor::AnimationLibraryEditor() {
set_title(TTR("Edit Animation Libraries"));
+ set_process_shortcut_input(true);
file_dialog = memnew(EditorFileDialog);
add_child(file_dialog);