summaryrefslogtreecommitdiff
path: root/src/input/inputmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-09 00:29:58 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-09 00:29:58 +0300
commiteef58035c1848a8cffbcb17373b6afbe43be1440 (patch)
treeec8ff687c1c15c6b3f8448e596f51de066a5717b /src/input/inputmanager.cpp
parent1f0070646425aeb23f01d769f5b1cf071d1d3d15 (diff)
downloadplus-eef58035c1848a8cffbcb17373b6afbe43be1440.tar.gz
plus-eef58035c1848a8cffbcb17373b6afbe43be1440.tar.bz2
plus-eef58035c1848a8cffbcb17373b6afbe43be1440.tar.xz
plus-eef58035c1848a8cffbcb17373b6afbe43be1440.zip
Add chat command for send any gui key.
New chat command: guikey.
Diffstat (limited to 'src/input/inputmanager.cpp')
-rw-r--r--src/input/inputmanager.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp
index eda8ba7b1..40397e91f 100644
--- a/src/input/inputmanager.cpp
+++ b/src/input/inputmanager.cpp
@@ -1019,6 +1019,18 @@ InputActionT InputManager::getActionByKey(const SDL_Event &restrict event)
return InputAction::NO_VALUE;
}
+InputActionT InputManager::getActionByConfigField(const std::string &field)
+ const restrict2
+{
+ for (int i = 0; i < CAST_S32(InputAction::TOTAL); i ++)
+ {
+ const std::string cf = inputActionData[i].configField;
+ if (field == cf)
+ return static_cast<InputActionT>(i);
+ }
+ return InputAction::NO_VALUE;
+}
+
void InputManager::addChatCommands(std::list<std::string> &restrict arr)
restrict
{