mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- simplified key repeat detection in SDL backend
This commit is contained in:
parent
0342bf532d
commit
0703030be3
1 changed files with 2 additions and 16 deletions
|
@ -64,8 +64,6 @@ EXTERN_CVAR (Bool, fullscreen)
|
|||
extern int WaitingForKey, chatmodeon;
|
||||
extern constate_e ConsoleState;
|
||||
|
||||
static bool DownState[SDL_NUM_SCANCODES];
|
||||
|
||||
static const SDL_Keycode DIKToKeySym[256] =
|
||||
{
|
||||
0, SDLK_ESCAPE, SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5, SDLK_6,
|
||||
|
@ -190,10 +188,6 @@ static void I_CheckGUICapture ()
|
|||
if (wantCapt != GUICapture)
|
||||
{
|
||||
GUICapture = wantCapt;
|
||||
if (wantCapt)
|
||||
{
|
||||
memset (DownState, 0, sizeof(DownState));
|
||||
}
|
||||
ResetButtonStates();
|
||||
}
|
||||
}
|
||||
|
@ -441,18 +435,10 @@ void MessagePump (const SDL_Event &sev)
|
|||
((kmod & KMOD_CTRL) ? GKM_CTRL : 0) |
|
||||
((kmod & KMOD_ALT) ? GKM_ALT : 0);
|
||||
|
||||
if (event.subtype == EV_GUI_KeyDown)
|
||||
{
|
||||
if (DownState[sev.key.keysym.scancode])
|
||||
if (event.subtype == EV_GUI_KeyDown && sev.key.repeat)
|
||||
{
|
||||
event.subtype = EV_GUI_KeyRepeat;
|
||||
}
|
||||
DownState[sev.key.keysym.scancode] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
DownState[sev.key.keysym.scancode] = 0;
|
||||
}
|
||||
|
||||
switch (sev.key.keysym.sym)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue