diff options
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r-- | scene/gui/control.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index e094a063be..dc042b88d2 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2062,8 +2062,11 @@ void Control::grab_focus() { if (!is_inside_tree()) { ERR_FAIL_COND(!is_inside_tree()); } - if (data.focus_mode == FOCUS_NONE) + + if (data.focus_mode == FOCUS_NONE) { + WARN_PRINT("This control can't grab focus. Use set_focus_mode() to allow a control to get focus."); return; + } get_viewport()->_gui_control_grab_focus(this); } @@ -2956,7 +2959,7 @@ void Control::_bind_methods() { BIND_ENUM_CONSTANT(ANCHOR_END); ADD_SIGNAL(MethodInfo("resized")); - ADD_SIGNAL(MethodInfo("gui_input", PropertyInfo(Variant::OBJECT, "ev", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); + ADD_SIGNAL(MethodInfo("gui_input", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); ADD_SIGNAL(MethodInfo("mouse_entered")); ADD_SIGNAL(MethodInfo("mouse_exited")); ADD_SIGNAL(MethodInfo("focus_entered")); |