summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2011-03-02 22:22:46 (GMT)
committer Simon <simon@hardwired.org.uk>2011-03-02 22:22:46 (GMT)
commit920e589d62da9cb507a835499f174cd505e92e1e (patch)
tree0463af3797453de62892d37099be6acb66642cc6 /src/interface.c
parent759dd045804fbef599e0a7faee3b110de4a38323 (diff)
downloadpowder-920e589d62da9cb507a835499f174cd505e92e1e.zip
powder-920e589d62da9cb507a835499f174cd505e92e1e.tar.gz
Enable key repeat for console
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/interface.c b/src/interface.c
index 9be3e6d..79ebcb1 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -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;
}