Commit 15e2f09e authored by Sam Lantinga's avatar Sam Lantinga

Don't worry about a minimum repeat rate - let the user hang themselves...

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40123
parent 1412a172
...@@ -49,7 +49,6 @@ static char *keynames[SDLK_LAST]; /* Array of keycode names */ ...@@ -49,7 +49,6 @@ static char *keynames[SDLK_LAST]; /* Array of keycode names */
/* /*
* jk 991215 - added * jk 991215 - added
*/ */
#define MINIMUM_REPEAT_INTERVAL 30 /* Minimum repeat interval (30 ms) */
struct { struct {
int firsttime; /* if we check against the delay or repeat value */ int firsttime; /* if we check against the delay or repeat value */
int delay; /* the delay before we start repeating */ int delay; /* the delay before we start repeating */
...@@ -556,17 +555,13 @@ void SDL_CheckKeyRepeat(void) ...@@ -556,17 +555,13 @@ void SDL_CheckKeyRepeat(void)
int SDL_EnableKeyRepeat(int delay, int interval) int SDL_EnableKeyRepeat(int delay, int interval)
{ {
if ( delay < 0 ) { if ( (delay < 0) || (interval < 0) ) {
SDL_SetError("keyboard repeat delay less than zero"); SDL_SetError("keyboard repeat value less than zero");
return(-1); return(-1);
} }
SDL_KeyRepeat.firsttime = 0; SDL_KeyRepeat.firsttime = 0;
SDL_KeyRepeat.delay = delay; SDL_KeyRepeat.delay = delay;
if ( interval < MINIMUM_REPEAT_INTERVAL ) { SDL_KeyRepeat.interval = interval;
SDL_KeyRepeat.interval = MINIMUM_REPEAT_INTERVAL;
} else {
SDL_KeyRepeat.interval = interval;
}
SDL_KeyRepeat.timestamp = 0; SDL_KeyRepeat.timestamp = 0;
return(0); return(0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment