### Godot version

v4.2.dev.custom_build [c3b0a92c3]

### System information

Debian Linux X11 Xfce

### Issue description

In the following scene tree it is not possible to write anything in `LineEditB`.
![image](https://github.com/godotengine/godot/assets/6299227/ce5f696a-d86a-402f-98f7-6a762f15543e)

I would expect, that it is possible to focus `LineEditB` with a mouse click and write into it.

Regression from #58334

### Steps to reproduce

1. Load and run MRP
2. Mouse Click into the left LineEditB
3. Type Keyboard => No letters appear in the LineEditB

Variant:

1. Load and run MRP
2. Mouse Click into the right LineEditA
3. Mouse Click into the left LineEditB
4. Type Keyboard => Letters appear in LineEditA instead of LineEditB


### Minimal reproduction project

[BugKeyInputRouting.zip](https://github.com/godotengine/godot/files/11994804/BugKeyInputRouting.zip)

mm->set_device(InputEvent::DEVICE_ID_INTERNAL);
		mm->set_position(get_mouse_position());
		mm->set_global_position(mm->get_position());
		mm->set_alt_pressed(Input::get_singleton()->is_key_pressed(Key::ALT));
		mm->set_shift_pressed(Input::get_singleton()->is_key_pressed(Key::SHIFT));
		mm->set_ctrl_pressed(Input::get_singleton()->is_key_pressed(Key::CTRL));
		mm->set_meta_pressed(Input::get_singleton()->is_key_pressed(Key::META));
		mm->set_button_mask(Input::get_singleton()->get_mouse_button_mask());
		physics_picking_events.push_back(mm);
	}
	while (physics_picking_events.size()) {
		local_input_handled = false;
		Ref<InputEvent> ev = physics_picking_events.front()->get();
		physics_picking_events.pop_front();
		Vector2 pos;
		bool is_mouse = false;
		Ref<InputEventMouseMotion> mm = ev;
		if (mm.is_valid()) {
			pos = mm->get_position();
			is_mouse = true;
		}
		Ref<InputEventMouseButton> mb = ev;
		if (mb.is_valid()) {
			pos = mb->get_position();
			is_mouse = true;
		}
		Ref<InputEventScreenDrag> sd = ev;
		if (sd.is_valid()) {
			pos = sd->get_position();
		}