From cea367c529bd8400a44fab3f580d43120457e1b9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 23 May 2017 23:03:45 +0300 Subject: Add chat command for send any number of pritable chars to input. --- src/actions/chat.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/actions/chat.cpp') 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 -- cgit v1.2.3-60-g2f50