summaryrefslogtreecommitdiff
path: root/src/keyboardconfig.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-31 23:42:43 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-01 18:47:54 +0300
commited3410d7eb61593a2235ddba97ce257c85e405a6 (patch)
tree565c93ff291f70749cda2f59a4cc6fcd015ff203 /src/keyboardconfig.cpp
parent386dac2875f4a5ad4a534c403338db3b26239a68 (diff)
downloadplus-ed3410d7eb61593a2235ddba97ce257c85e405a6.tar.gz
plus-ed3410d7eb61593a2235ddba97ce257c85e405a6.tar.bz2
plus-ed3410d7eb61593a2235ddba97ce257c85e405a6.tar.xz
plus-ed3410d7eb61593a2235ddba97ce257c85e405a6.zip
Add const to more classes.
Diffstat (limited to 'src/keyboardconfig.cpp')
-rw-r--r--src/keyboardconfig.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp
index 742dd69d5..043024796 100644
--- a/src/keyboardconfig.cpp
+++ b/src/keyboardconfig.cpp
@@ -64,7 +64,7 @@ int KeyboardConfig::getKeyValueFromEvent(const SDL_Event &event) const
return 0;
}
-int KeyboardConfig::getKeyIndex(const SDL_Event &event, int grp) const
+int KeyboardConfig::getKeyIndex(const SDL_Event &event, const int grp) const
{
const int keyValue = getKeyValueFromEvent(event);
return inputManager.getKeyIndex(keyValue, grp, INPUT_KEYBOARD);
@@ -75,7 +75,7 @@ void KeyboardConfig::refreshActiveKeys()
mActiveKeys = SDL_GetKeyState(nullptr);
}
-std::string KeyboardConfig::getKeyName(int key)
+std::string KeyboardConfig::getKeyName(const int key) const
{
if (key == Input::KEY_NO_VALUE)
return "";
@@ -113,7 +113,7 @@ KeysVector *KeyboardConfig::getActionVector(const SDL_Event &event)
return nullptr;
}
-KeysVector *KeyboardConfig::getActionVectorByKey(int i)
+KeysVector *KeyboardConfig::getActionVectorByKey(const int i)
{
// logger->log("key triggerAction: %d", i);
if (i != 0 && i < SDLK_LAST && mKeyToAction.find(i) != mKeyToAction.end())
@@ -130,7 +130,7 @@ int KeyboardConfig::getActionId(const SDL_Event &event)
return -1;
}
-bool KeyboardConfig::isActionActive(int index) const
+bool KeyboardConfig::isActionActive(const int index) const
{
if (!mActiveKeys)
return false;
@@ -178,7 +178,7 @@ void KeyboardConfig::handleDeActicateKey(const SDL_Event &event)
resetRepeat(key);
}
-void KeyboardConfig::handleRepeat(int time)
+void KeyboardConfig::handleRepeat(const int time)
{
for (KeyTimeMapIter it = mKeyTimeMap.begin(), it_end = mKeyTimeMap.end();
it != it_end; ++ it)
@@ -204,9 +204,9 @@ void KeyboardConfig::handleRepeat(int time)
}
}
-void KeyboardConfig::resetRepeat(int key)
+void KeyboardConfig::resetRepeat(const int key)
{
- KeyTimeMapIter it = mKeyTimeMap.find(key);
+ const KeyTimeMapIter it = mKeyTimeMap.find(key);
if (it != mKeyTimeMap.end())
(*it).second = tick_time;
}