Minor code cleanup

This commit is contained in:
Alex Szpakowski
2014-05-01 14:12:21 -03:00
parent e667485f68
commit e4dc533bb2
26 changed files with 112 additions and 110 deletions
+2 -3
View File
@@ -51,12 +51,11 @@ bool Keyboard::hasKeyRepeat() const
bool Keyboard::isDown(Key *keylist) const
{
const Uint8 *keystate = SDL_GetKeyboardState(0);
std::map<Key, SDL_Keycode>::const_iterator it;
const Uint8 *keystate = SDL_GetKeyboardState(nullptr);
for (Key key = *keylist; key != KEY_MAX_ENUM; key = *(++keylist))
{
it = keys.find(key);
auto it = keys.find(key);
if (it != keys.end() && keystate[SDL_GetScancodeFromKey(it->second)])
return true;
}
+2
View File
@@ -56,6 +56,8 @@ public:
private:
// Whether holding down a key triggers repeated key press events.
// The real implementation is in love::event::sdl::Event::Convert.
bool key_repeat;
static std::map<Key, SDL_Keycode> createKeyMap();