diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-23 23:03:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-23 23:03:45 +0300 |
commit | cea367c529bd8400a44fab3f580d43120457e1b9 (patch) | |
tree | f33d4393865bdf2f6bff041002243583605f1de4 /src/actions/chat.cpp | |
parent | 7863473dc201f4a497669cbf69875eb6e9389273 (diff) | |
download | mv-cea367c529bd8400a44fab3f580d43120457e1b9.tar.gz mv-cea367c529bd8400a44fab3f580d43120457e1b9.tar.bz2 mv-cea367c529bd8400a44fab3f580d43120457e1b9.tar.xz mv-cea367c529bd8400a44fab3f580d43120457e1b9.zip |
Add chat command for send any number of pritable chars to input.
Diffstat (limited to 'src/actions/chat.cpp')
-rw-r--r-- | src/actions/chat.cpp | 19 |
1 files changed, 19 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 |