shithub: choc

Download patch

ref: 47ae7506fc1e286cbce74f1126fa016f31d71996
parent: b65c4617a657cf2cc5848efcc8753bcc6f67fdca
author: Simon Howard <[email protected]>
date: Mon Sep 18 08:13:40 EDT 2006

Repeat key presses when the key is held down - thanks to Mad_Mac for this
one :-)

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 613

--- 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>
@@ -1262,6 +1262,12 @@
     // We need SDL to give us translated versions of keys as well
 
     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
   
--- a/textscreen/txt_main.c
+++ b/textscreen/txt_main.c
@@ -88,6 +88,11 @@
 
     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;
 }