Enable key repeat for console
This commit is contained in:
parent
759dd04580
commit
920e589d62
@ -3865,6 +3865,9 @@ char *console_ui(pixel *vid_buf,char error[255],char console_more) {
|
||||
//fillrect(vid_buf, -1, -1, XRES, 220, 0, 0, 0, 190);
|
||||
memcpy(old_buf,vid_buf,(XRES+BARSIZE)*YRES*PIXELSIZE);
|
||||
fillrect(old_buf, -1, -1, XRES, 220, 0, 0, 0, 190);
|
||||
|
||||
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
|
||||
cc = 0;
|
||||
while(cc < 80){
|
||||
fillrect(old_buf, -1, -1+cc, XRES+BARSIZE, 2, 0, 0, 0, 160-(cc*2));
|
||||
@ -3923,12 +3926,14 @@ char *console_ui(pixel *vid_buf,char error[255],char console_more) {
|
||||
currentcommand->command = mystrdup(ed.str);
|
||||
last_command = currentcommand;
|
||||
free(old_buf);
|
||||
SDL_EnableKeyRepeat(0, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
return currentcommand->command;
|
||||
}
|
||||
if (sdl_key==SDLK_ESCAPE || sdl_key==SDLK_BACKQUOTE)
|
||||
{
|
||||
console_mode = 0;
|
||||
free(old_buf);
|
||||
SDL_EnableKeyRepeat(0, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
return NULL;
|
||||
}
|
||||
if(sdl_key==SDLK_UP || sdl_key==SDLK_DOWN)
|
||||
@ -3965,6 +3970,7 @@ char *console_ui(pixel *vid_buf,char error[255],char console_more) {
|
||||
}
|
||||
console_mode = 0;
|
||||
free(old_buf);
|
||||
SDL_EnableKeyRepeat(0, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user