Integer Entrys - len will be the integer max value

origin
stpohle 22 years ago
parent cbd36b4006
commit 4d7f466548

@ -2,6 +2,8 @@
#include <SDL.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "keybinput.h"
static int keybinput_oldkey = 0;
@ -45,7 +47,9 @@ int keybinput_loop (_keybinput *ki, SDL_Event *event) {
else if (ki->type == KEYBI_int && (keyu == '-' || (keyu >= '0' && keyu <= '9'))) {
/* only integers will be read */
if (ki->curpos < 255) {
ki->text[ki->curpos++] = event->key.keysym.unicode;
ki->text[ki->curpos] = event->key.keysym.unicode;
if (atoi(ki->text) <= ki->maxlen)
ki->curpos++;
ki->text[ki->curpos] = 0;
ki->changed = 1;
}

Loading…
Cancel
Save