mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-31 11:19:18 -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;
|
//if (*value > maxValue) *value = maxValue;
|
||||||
//else if (*value < minValue) *value = minValue;
|
//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;
|
if (*value > maxValue) *value = maxValue;
|
||||||
else if (*value < minValue) *value = minValue;
|
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 (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
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user