godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.37k stars 21.26k forks source link

Textboxes trap the input using keyboard only #27036

Open HeartoLazor opened 5 years ago

HeartoLazor commented 5 years ago

Godot version: 3.1 stable

OS/device including version: Windows 10

Issue description: When the user moves with only the keyboard or a joystick pad, if the current focused object is a lineedit or textedit, the user can't leave the textbox using left and right arrows in lineedit and left, right, up, down in case of textedit multiline The user never should be locked in an input, this default behavior breaks the joystick only games by default, with textedit the only way to leave the textbox is using mouse o keyboard prev/next focus key.

Steps to reproduce: Create a lineedit or textedit. Add some other nodes at left, right, up, down from textbox. In line edit case focus the lineedit and try to leave using only left, right. In textedit case focus the textedit and try to leave using only arrows.

How I expect to be in all textboxes for consistency: When the caret is after the last character if the user press right again, change focus to right object. When the caret is before first character if the user press left again, change focus to left object. When the caret is in the first line and before the first character, if the user press up again, change focus to top object. When the caret is in the last line and after the last character, if the user press down again, change focus to bot object.

Minimal reproduction project: I applied my idea as a script using the neighbour attributes for lineedit, but it should be the default behavior without using neighbour attributes. And there are examples without the script with the default godot behavior. next_textbox_3.1.zip

akien-mga commented 5 years ago

For the reference, #27118 aimed at fixing this issue but was rejected. @Paulb23's comment:

I don't think this is the correct way to solve this.

For exiting out of text controls, I've seen:

  • Tab / Shift+tab is not handled by the control however, switches focus.
  • Have two modes, selection and active. In this example it will enter selection mode by default, here the control border is highlighted. Focus navigation is as normal. When the action button is pressed, the control enters active mode. Here it captures text input. Then by pressing the back action it goes into selection mode again.
  • A different shortcut to switch focus.
CsloudX commented 1 year ago

I'm meeting this issue now, any updating of this issue?

KoBeWi commented 5 days ago

Partially fixed by #87674 Needs to be implemented for TextEdit too.