1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Implement new shortcuts system.

unhandled_key_input changed to unhandled_button_input. Controls can set a 'shortcut_context' which they can then use to determine if their shortcuts should be triggered or not, based on if the viewport's focused GUI control is a child of their 'shortcut context'.
This commit is contained in:
Eric M
2020-09-17 11:40:00 +10:00
parent fc806409f4
commit efe5c250d5
26 changed files with 154 additions and 54 deletions

View File

@@ -1210,9 +1210,11 @@ void AnimationPlayerEditor::_unhandled_key_input(const Ref<InputEvent> &p_ev) {
} else {
_play_bw_pressed();
}
accept_event();
} break;
case KEY_S: {
_stop_pressed();
accept_event();
} break;
case KEY_D: {
if (!k->get_shift()) {
@@ -1220,6 +1222,7 @@ void AnimationPlayerEditor::_unhandled_key_input(const Ref<InputEvent> &p_ev) {
} else {
_play_pressed();
}
accept_event();
} break;
}
}
@@ -1545,6 +1548,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay
delete_dialog->connect("confirmed", callable_mp(this, &AnimationPlayerEditor::_animation_remove_confirmed));
tool_anim = memnew(MenuButton);
tool_anim->set_shortcut_context(this);
tool_anim->set_flat(false);
tool_anim->set_tooltip(TTR("Animation Tools"));
tool_anim->set_text(TTR("Animation"));