diff options
Diffstat (limited to 'src/gui/sdlinput.cpp')
-rw-r--r-- | src/gui/sdlinput.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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); +} |