keys.c (Key_Event): Allow autorepeats in message (chat) mode; based on a

patch from Sander van Dijk.  Rearrange the autorepeat condition checks a
bit, based on uhexen2.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@522 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2011-12-15 16:33:52 +00:00
parent 7504e175e9
commit 9155f744d6
1 changed files with 11 additions and 2 deletions

View File

@ -861,13 +861,22 @@ void Key_Event (int key, qboolean down)
if (down) if (down)
{ {
key_repeats[key]++; key_repeats[key]++;
if (key_dest != key_console && key_repeats[key] > 1 && !repeatkeys[key]) //johnfitz -- use repeatkeys[] if (key_repeats[key] > 1)
return; // ignore most autorepeats {
if (key_dest == key_console)
goto autorep0;
if (key_dest == key_message)
goto autorep0;
if (!repeatkeys[key]) //johnfitz -- use repeatkeys[]
return; // ignore most autorepeats
}
if (key >= 200 && !keybindings[key]) if (key >= 200 && !keybindings[key])
Con_Printf ("%s is unbound, hit F4 to set.\n", Key_KeynumToString (key) ); Con_Printf ("%s is unbound, hit F4 to set.\n", Key_KeynumToString (key) );
} }
autorep0:
if (key == K_SHIFT) if (key == K_SHIFT)
shift_down = down; shift_down = down;