Skip to content

Commit

Permalink
Merge pull request #80594 from rsubtil/fix_window_input_event
Browse files Browse the repository at this point in the history
Support other input methods on Popup/Dialogs' `_input_from_window`
  • Loading branch information
akien-mga committed Aug 14, 2023
2 parents 122f373 + f092725 commit 0308422
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions scene/gui/dialogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
// AcceptDialog

void AcceptDialog::_input_from_window(const Ref<InputEvent> &p_event) {
Ref<InputEventKey> key = p_event;
if (close_on_escape && key.is_valid() && key->is_action_pressed(SNAME("ui_cancel"), false, true)) {
if (close_on_escape && p_event->is_action_pressed(SNAME("ui_cancel"), false, true)) {
_cancel_pressed();
}
}
Expand Down
3 changes: 1 addition & 2 deletions scene/gui/popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
#include "scene/gui/panel.h"

void Popup::_input_from_window(const Ref<InputEvent> &p_event) {
Ref<InputEventKey> key = p_event;
if (get_flag(FLAG_POPUP) && key.is_valid() && key->is_action_pressed(SNAME("ui_cancel"), false, true)) {
if (get_flag(FLAG_POPUP) && p_event->is_action_pressed(SNAME("ui_cancel"), false, true)) {
_close_pressed();
}
}
Expand Down

0 comments on commit 0308422

Please sign in to comment.