summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2006-09-18 12:13:40 +0000
committerSimon Howard2006-09-18 12:13:40 +0000
commit47ae7506fc1e286cbce74f1126fa016f31d71996 (patch)
treee33fb55bbefea7dff8980e0005776bb6682c256d
parentb65c4617a657cf2cc5848efcc8753bcc6f67fdca (diff)
downloadchocolate-doom-47ae7506fc1e286cbce74f1126fa016f31d71996.tar.gz
chocolate-doom-47ae7506fc1e286cbce74f1126fa016f31d71996.tar.bz2
chocolate-doom-47ae7506fc1e286cbce74f1126fa016f31d71996.zip
Repeat key presses when the key is held down - thanks to Mad_Mac for this
one :-) Subversion-branch: /trunk/chocolate-doom Subversion-revision: 613
-rw-r--r--src/i_video.c10
-rw-r--r--textscreen/txt_main.c5
2 files changed, 13 insertions, 2 deletions
diff --git a/src/i_video.c b/src/i_video.c
index c2e33058..ea99cfb7 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_video.c 598 2006-09-09 15:49:39Z fraggle $
+// $Id: i_video.c 613 2006-09-18 12:13:40Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -175,7 +175,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: i_video.c 598 2006-09-09 15:49:39Z fraggle $";
+rcsid[] = "$Id: i_video.c 613 2006-09-18 12:13:40Z fraggle $";
#include <SDL.h>
#include <ctype.h>
@@ -1263,6 +1263,12 @@ void I_InitGraphics(void)
SDL_EnableUNICODE(1);
+ // Repeat key presses - this is what Vanilla Doom does
+ // Not sure about repeat rate - probably dependent on which DOS
+ // driver is used. This is good enough though.
+
+ SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
+
// clear out any events waiting at the start
while (SDL_PollEvent(&dummy));
diff --git a/textscreen/txt_main.c b/textscreen/txt_main.c
index 5ecd590b..f580d942 100644
--- a/textscreen/txt_main.c
+++ b/textscreen/txt_main.c
@@ -88,6 +88,11 @@ int TXT_Init(void)
SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);
+ // Repeat key presses so we can hold down arrows to scroll down the
+ // menu, for example. This is what setup.exe does.
+
+ SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
+
return 1;
}