mirror of
https://github.com/raysan5/raygui.git
synced 2025-12-25 10:22:33 -05:00
Support keypad Enter key with GuiValueBox and GuiValueBoxFloat. (#413)
This commit is contained in:
@ -2903,7 +2903,7 @@ int GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, in
|
||||
//if (*value > maxValue) *value = maxValue;
|
||||
//else if (*value < minValue) *value = minValue;
|
||||
|
||||
if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)))
|
||||
if ((IsKeyPressed(KEY_ENTER) || IsKeyPressed(KEY_KP_ENTER)) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)))
|
||||
{
|
||||
if (*value > maxValue) *value = maxValue;
|
||||
else if (*value < minValue) *value = minValue;
|
||||
@ -3019,7 +3019,7 @@ int GuiValueBoxFloat(Rectangle bounds, const char *text, char *textValue, float
|
||||
|
||||
if (valueHasChanged) *value = TextToFloat(textValue);
|
||||
|
||||
if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) result = 1;
|
||||
if ((IsKeyPressed(KEY_ENTER) || IsKeyPressed(KEY_KP_ENTER)) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) result = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user