Closed danielchasehooper closed 8 months ago
I didn't add it because it could be problematic for some users. In my tools I just manage it on user-side, that's a benefit of the functions that register the edition mode.
Problematic? How so? That's how OS controls work.
What is the edition mode? I don't see anything named like that in the code.
This is how I use the GuiTextBox()
:
// User side GuiTexBox variables
char textBoxText[64] = "My text";
bool textBoxEditMode = false;
// Control drawing (ENTER accepts input text)
if (GuiTextBox((Rectangle){ 25, 215, 125, 30 }, textBoxText, 64, textBoxEditMode)) textBoxEditMode = !textBoxEditMode;
// But... what should happen if ESCAPE is pressed? Accept current input or cancel current edition?
if (textBoxEditMode && IsKeyPressed(KEY_ESCAPE))
{
// In some of my tools ESCAPE is used to undo current edit and return to previous value (rGuiLayout tool)
// So users are free to manage that kind of scenarios themselfs
textBoxEditMode = false;
}
Escape key should be managed at user level due to the implications it could imply on main program.
ESC doesn't abort textfield editing. Yes I know esc by default closes raylib, but if you called
SetExitKey(0);
, you kinda expect to be able to press escape to cancel editing a GuiValueBox.