1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

use ED_IS_SHORTCUT macro instead of matches_event

This commit is contained in:
CookieBadger
2024-02-15 16:26:33 +01:00
committed by emild
parent 0246230e2b
commit 47dba6bc56
3 changed files with 21 additions and 21 deletions

View File

@@ -834,20 +834,20 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
}
if (p_event->is_pressed()) {
if (ED_GET_SHORTCUT("animation_editor/duplicate_selected_keys")->matches_event(p_event)) {
if (ED_IS_SHORTCUT("animation_editor/duplicate_selected_keys", p_event)) {
if (!read_only) {
duplicate_selected_keys(-1.0);
}
accept_event();
}
if (ED_GET_SHORTCUT("animation_editor/copy_selected_keys")->matches_event(p_event)) {
if (ED_IS_SHORTCUT("animation_editor/copy_selected_keys", p_event)) {
if (!read_only) {
copy_selected_keys(false);
}
accept_event();
}
if (ED_GET_SHORTCUT("animation_editor/paste_keys")->matches_event(p_event)) {
if (ED_IS_SHORTCUT("animation_editor/paste_keys", p_event)) {
if (!read_only) {
paste_keys(-1.0);
}
@@ -858,7 +858,7 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventKey> key_press = p_event;
if (key_press.is_valid() && key_press->is_pressed()) {
if (ED_GET_SHORTCUT("animation_bezier_editor/focus")->matches_event(p_event)) {
if (ED_IS_SHORTCUT("animation_bezier_editor/focus", p_event)) {
SelectionSet focused_keys;
if (selection.is_empty()) {
for (int i = 0; i < edit_points.size(); ++i) {
@@ -927,7 +927,7 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
queue_redraw();
accept_event();
return;
} else if (ED_GET_SHORTCUT("animation_bezier_editor/select_all_keys")->matches_event(p_event)) {
} else if (ED_IS_SHORTCUT("animation_bezier_editor/select_all_keys", p_event)) {
for (int i = 0; i < edit_points.size(); ++i) {
selection.insert(IntPair(edit_points[i].track, edit_points[i].key));
}
@@ -935,7 +935,7 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
queue_redraw();
accept_event();
return;
} else if (ED_GET_SHORTCUT("animation_bezier_editor/deselect_all_keys")->matches_event(p_event)) {
} else if (ED_IS_SHORTCUT("animation_bezier_editor/deselect_all_keys", p_event)) {
selection.clear();
queue_redraw();