mirror of
https://github.com/godotengine/godot.git
synced 2026-02-07 19:32:36 +00:00
Fix editor tooltips disappearing with joypads
This commit is contained in:
@@ -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<StringName, Input::ActionState> &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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user