From eef58035c1848a8cffbcb17373b6afbe43be1440 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 9 May 2017 00:29:58 +0300 Subject: Add chat command for send any gui key. New chat command: guikey. --- src/gui/sdlinput.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gui/sdlinput.cpp') diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp index 7d964b030..29b6534c1 100644 --- a/src/gui/sdlinput.cpp +++ b/src/gui/sdlinput.cpp @@ -359,3 +359,14 @@ void SDLInput::simulateMouseMove() mouseInput.setTimeStamp(SDL_GetTicks()); mMouseInputQueue.push(mouseInput); } + +void SDLInput::simulateKey(const int guiKey, + const InputActionT actionId) +{ + KeyInput keyInput; + keyInput.setType(KeyEventType::PRESSED); + keyInput.setKey(Key(guiKey)); + if (actionId > InputAction::NO_VALUE) + keyInput.setActionId(actionId); + mKeyInputQueue.push(keyInput); +} -- cgit v1.2.3-60-g2f50