|
|
@ -2,6 +2,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include <SDL.h>
|
|
|
|
#include <SDL.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "keybinput.h"
|
|
|
|
#include "keybinput.h"
|
|
|
|
|
|
|
|
|
|
|
|
static int keybinput_oldkey = 0;
|
|
|
|
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'))) {
|
|
|
|
else if (ki->type == KEYBI_int && (keyu == '-' || (keyu >= '0' && keyu <= '9'))) {
|
|
|
|
/* only integers will be read */
|
|
|
|
/* only integers will be read */
|
|
|
|
if (ki->curpos < 255) {
|
|
|
|
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->text[ki->curpos] = 0;
|
|
|
|
ki->changed = 1;
|
|
|
|
ki->changed = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|