Shortcut: Rename shortcut property to event

Having a property which has the same name as its class leads to confusing
situations (e.g. `BaseButton` has a `shortcut` property of type `Shortcut`
which has a `shortcut` property of type `InputEvent`).

Also renames `is_event` to `matches_event`, and `is_valid` to `has_valid_event`
to better reflect what the methods check.
This commit is contained in:
Rémi Verschelde
2021-08-03 17:27:45 +02:00
parent 1eff610e2b
commit de2c2be19b
11 changed files with 69 additions and 74 deletions
+2 -2
View File
@@ -605,12 +605,12 @@ void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
ERR_FAIL_COND(p_event.is_null());
if (p_event->is_pressed()) {
if (ED_GET_SHORTCUT("animation_editor/duplicate_selection")->is_shortcut(p_event)) {
if (ED_GET_SHORTCUT("animation_editor/duplicate_selection")->matches_event(p_event)) {
duplicate_selection();
accept_event();
}
if (ED_GET_SHORTCUT("animation_editor/delete_selection")->is_shortcut(p_event)) {
if (ED_GET_SHORTCUT("animation_editor/delete_selection")->matches_event(p_event)) {
delete_selection();
accept_event();
}