Fix for the "stuck enter key" bug (now SDL's key repeat is disabled on game launch then re-eanbled on termination).

This commit is contained in:
Aloshi 2012-07-21 14:16:53 -05:00
parent bbfe35a36d
commit a801ad7505

View file

@ -1,6 +1,7 @@
#include "GuiGameList.h" #include "GuiGameList.h"
#include "../InputManager.h" #include "../InputManager.h"
#include <iostream> #include <iostream>
#include <SDL/SDL.h>
GuiGameList::GuiGameList(SystemData* system) GuiGameList::GuiGameList(SystemData* system)
{ {
@ -33,7 +34,9 @@ void GuiGameList::onInput(InputManager::InputButton button, bool keyDown)
{ {
if(button == InputManager::BUTTON1 && keyDown) if(button == InputManager::BUTTON1 && keyDown)
{ {
SDL_EnableKeyRepeat(0, 0);
mSystem->launchGame(mList->getSelection()); mSystem->launchGame(mList->getSelection());
SDL_EnableKeyRepeat(500, 100);
} }
} }