diff --git a/core/input/input.cpp b/core/input/input.cpp index c75079206c9..a6f727fb69e 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -296,24 +296,14 @@ bool Input::is_anything_pressed() const { return false; } -bool Input::is_anything_pressed_except_mouse() const { +bool Input::is_any_key_pressed() const { _THREAD_SAFE_METHOD_ if (disable_input) { return false; } - if (!keys_pressed.is_empty() || !joy_buttons_pressed.is_empty()) { - return true; - } - - for (const KeyValue &E : action_states) { - if (E.value.cache.pressed) { - return true; - } - } - - return false; + return !keys_pressed.is_empty(); } bool Input::is_key_pressed(Key p_keycode) const { diff --git a/core/input/input.h b/core/input/input.h index c912cb34d3c..db8459a6bc1 100644 --- a/core/input/input.h +++ b/core/input/input.h @@ -312,7 +312,7 @@ public: static Input *get_singleton(); bool is_anything_pressed() const; - bool is_anything_pressed_except_mouse() const; + bool is_any_key_pressed() const; bool is_key_pressed(Key p_keycode) const; bool is_physical_key_pressed(Key p_keycode) const; bool is_key_label_pressed(Key p_keycode) const; diff --git a/editor/doc/editor_help.cpp b/editor/doc/editor_help.cpp index b20e9ccee8a..881b8aa6ac2 100644 --- a/editor/doc/editor_help.cpp +++ b/editor/doc/editor_help.cpp @@ -4681,7 +4681,7 @@ void EditorHelpBitTooltip::_notification(int p_what) { if (Input::get_singleton()->is_action_just_pressed(SNAME("ui_cancel"), true)) { queue_free(); get_parent_viewport()->set_input_as_handled(); - } else if (Input::get_singleton()->is_anything_pressed_except_mouse()) { + } else if (Input::get_singleton()->is_any_key_pressed()) { queue_free(); } else if (!Input::get_singleton()->get_mouse_button_mask().is_empty()) { if (!_is_mouse_inside_tooltip) {