flareteam / flare-engine

Free/Libre Action Roleplaying Engine (engine only)
http://flarerpg.org/
GNU General Public License v3.0
1.1k stars 186 forks source link

Cannot reach text input field without a mouse #724

Closed makrohn closed 7 years ago

makrohn commented 11 years ago

As I mentioned in #722, it is currently impossible to get to the text input field in GameStateNew if you're using mouseless controls.

Dorkster commented there:

"So far, we've mostly thought of mouse-less systems as systems that don't have a proper keyboard either, like the GCW-Zero. I think we could solve this by adding a way to toggle a WidgetInput's active state. In other words, press Enter to start typing, press Enter again to finish."

igorko commented 11 years ago

Mouseless devices don't have character keys, so it's useless to set focus to inputbox because we can't type text. We only can use default names instead.

makrohn commented 11 years ago

I didn't know if my mouseless devices we meant, for instance, a Wii which might have a Wiimote and a USB keyboard, or just game controllers.

clintbellanger commented 10 years ago

I think hitting enter to activate/deactivate focus on the input widget is a good idea. We'll reclassify this as a feature instead of a bug because the use case is pretty obscure. We provided default names for hero portraits so that typing a name isn't required.

dorkster commented 7 years ago

SDL 2 has SDL_StartTextInput, SDL_HasScreenKeyboardSupport, and SDL_IsScreenKeyboardShown, which could help us handle this on devices without physical keyboards

dorkster commented 7 years ago

I've implemented Clint's idea of having Enter toggle WidgetInput's edit state. I also made a few improvements to WidgetInput in general. It's now possible to control the cursor position with the arrow keys as one would expect from a text entry field.

I know I mentioned getting the on-screen keyboard working for touch devices, but I'll consider that a separate issue and mark this one as finished.

dorkster commented 7 years ago

On-screen keyboard support has been added, so text input is possible on phones/tablets now. Since the keyboard usually covers up the area you're typing in, I've opted to display the WidgetInput text in a tooltip at the top of the screen (see image).

screenshot_2017-08-18-16-51-21