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);
|
//fillrect(vid_buf, -1, -1, XRES, 220, 0, 0, 0, 190);
|
||||||
memcpy(old_buf,vid_buf,(XRES+BARSIZE)*YRES*PIXELSIZE);
|
memcpy(old_buf,vid_buf,(XRES+BARSIZE)*YRES*PIXELSIZE);
|
||||||
fillrect(old_buf, -1, -1, XRES, 220, 0, 0, 0, 190);
|
fillrect(old_buf, -1, -1, XRES, 220, 0, 0, 0, 190);
|
||||||
|
|
||||||
|
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||||
|
|
||||||
cc = 0;
|
cc = 0;
|
||||||
while(cc < 80){
|
while(cc < 80){
|
||||||
fillrect(old_buf, -1, -1+cc, XRES+BARSIZE, 2, 0, 0, 0, 160-(cc*2));
|
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);
|
currentcommand->command = mystrdup(ed.str);
|
||||||
last_command = currentcommand;
|
last_command = currentcommand;
|
||||||
free(old_buf);
|
free(old_buf);
|
||||||
|
SDL_EnableKeyRepeat(0, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||||
return currentcommand->command;
|
return currentcommand->command;
|
||||||
}
|
}
|
||||||
if (sdl_key==SDLK_ESCAPE || sdl_key==SDLK_BACKQUOTE)
|
if (sdl_key==SDLK_ESCAPE || sdl_key==SDLK_BACKQUOTE)
|
||||||
{
|
{
|
||||||
console_mode = 0;
|
console_mode = 0;
|
||||||
free(old_buf);
|
free(old_buf);
|
||||||
|
SDL_EnableKeyRepeat(0, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if(sdl_key==SDLK_UP || sdl_key==SDLK_DOWN)
|
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;
|
console_mode = 0;
|
||||||
free(old_buf);
|
free(old_buf);
|
||||||
|
SDL_EnableKeyRepeat(0, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user