From 47ae7506fc1e286cbce74f1126fa016f31d71996 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 18 Sep 2006 12:13:40 +0000 Subject: Repeat key presses when the key is held down - thanks to Mad_Mac for this one :-) Subversion-branch: /trunk/chocolate-doom Subversion-revision: 613 --- src/i_video.c | 10 ++++++++-- textscreen/txt_main.c | 5 +++++ 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 #include @@ -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; } -- cgit v1.2.3