Make input boxes actually take input
This commit is contained in:
parent
3d27deb8f4
commit
40062fcdc2
2 changed files with 13 additions and 4 deletions
|
|
@ -3346,9 +3346,18 @@ int GuiValueBoxFloat(Rectangle bounds, const char *text, char *textValue, float
|
||||||
{
|
{
|
||||||
if (GuiGetTextWidth(textValue) < bounds.width)
|
if (GuiGetTextWidth(textValue) < bounds.width)
|
||||||
{
|
{
|
||||||
int key = GUI_INPUT_KEY;
|
int key = 0;
|
||||||
if (key != 0) {
|
for (int i = 0; i < 10; i++) {
|
||||||
key = key;
|
if (GUI_KEY_PRESSED(KEY_ZERO + i)) {
|
||||||
|
key = KEY_ZERO + i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (key == 0 && GUI_KEY_PRESSED(KEY_MINUS)) {
|
||||||
|
key = '-';
|
||||||
|
}
|
||||||
|
if (key == 0 && GUI_KEY_PRESSED(KEY_PERIOD)) {
|
||||||
|
key = '.';
|
||||||
}
|
}
|
||||||
if (((key >= 48) && (key <= 57)) ||
|
if (((key >= 48) && (key <= 57)) ||
|
||||||
(key == '.') ||
|
(key == '.') ||
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue