Closed jonSP12 closed 1 month ago
It's my understanding that _gui_input() is dedicated to mouse inputs on specific GUI elements. I think this is a documentation issue rather than a bug.
It also doesnt receive the signal focus entered() https://github.com/godotengine/godot/issues/43338
only the mouse enter() seems to work This is a little weird since the godot editor / node inspector, is full of tiny boxes that receive floats inputs, such has position / offset / size / shader paramenter..etc...
It's because the internal LineEdit
handles that key press, so the event won't be propagated to SpinBox
.
So you should get the LineEdit
with get_line_edit()
and listen to its gui_input
signal instead. You can also use the text_submitted
instead if you only want the enter key pressed event.
It's because the internal
LineEdit
handles that key press, so the event won't be propagated toSpinBox
.So you should get the
LineEdit
withget_line_edit()
and listen to itsgui_input
signal instead. You can also use thetext_submitted
instead if you only want the enter key pressed event.
Yes... but i my case get_line_edit() always returns null ?!?! Cannot connect to 'focus_entered': the provided callable is null.
@onready var spinBx = get_node_or_null("../../../../C_OP/SpinBox");
var spinBx2;
func _ready():
spinBx2 = spinBx.get_line_edit();
spinBx2.connect("focus_entered", self, "spinBx2_on_focus_entered");
spinBx2.connect("focus_exited()", self, "spinBx2_on_focus_exited");
I just cant understand this ?
Did you mean this as your code:
@onready var spinBx = get_node_or_null("../../../../C_OP/SpinBox");
var spinBx2;
func _ready():
spinBx2 = spinBx.get_line_edit();
spinBx2.focus_entered.connect(spinBx2_on_focus_entered);
spinBx2.focus_exited.connect(spinBx2_on_focus_exited);
Your code isn't valid 4.x code
thanks it works now
Tested versions
4.3 stable
System information
windows 10
Issue description
https://github.com/godotengine/godot/issues/43701
spinBox node doesnt detect key inputs on signal gui input( event: InputEvent ) "Emitted when node receives an Input Event"
Steps to reproduce
make a plugIN add an instance with a spinBox node with the signal gui input
It only reads mouse inputs when:
Minimal reproduction project (MRP)
spinbox.zip