summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-23 23:03:45 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-23 23:03:45 +0300
commitcea367c529bd8400a44fab3f580d43120457e1b9 (patch)
treef33d4393865bdf2f6bff041002243583605f1de4 /src/actions
parent7863473dc201f4a497669cbf69875eb6e9389273 (diff)
downloadplus-cea367c529bd8400a44fab3f580d43120457e1b9.tar.gz
plus-cea367c529bd8400a44fab3f580d43120457e1b9.tar.bz2
plus-cea367c529bd8400a44fab3f580d43120457e1b9.tar.xz
plus-cea367c529bd8400a44fab3f580d43120457e1b9.zip
Add chat command for send any number of pritable chars to input.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/chat.cpp19
-rw-r--r--src/actions/chat.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp
index d8743e06a..4f69b31b8 100644
--- a/src/actions/chat.cpp
+++ b/src/actions/chat.cpp
@@ -780,4 +780,23 @@ impHandler(sendMouseKey)
return true;
}
+impHandler(sendChars)
+{
+ if (!guiInput)
+ return false;
+
+ const std::string args = event.args;
+ if (args.empty())
+ return false;
+
+ const size_t sz = args.size();
+ for (size_t f = 0; f < sz; f ++)
+ {
+ guiInput->simulateKey(CAST_S32(args[f]),
+ InputAction::NO_VALUE);
+ }
+
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/chat.h b/src/actions/chat.h
index 5d4f1c02d..0e3c362a7 100644
--- a/src/actions/chat.h
+++ b/src/actions/chat.h
@@ -64,6 +64,7 @@ namespace Actions
decHandler(translate);
decHandler(sendGuiKey);
decHandler(sendMouseKey);
+ decHandler(sendChars);
} // namespace Actions
#undef decHandler