| 123456789101112131415161718192021222324252627282930313233 |
- /*
- * author: Patrick-Christopher Mattulat
- * e-mail: webmaster@lynarstudios.com
- */
- #include <glossary/KeyboardKeys.hpp>
- #include <interface/IKeyboard.hpp>
- #include <window/SdlKeyEventManager.hpp>
- using ls::atlantis::glossary::KeyboardKeys;
- using ls::atlantis::interfaces::IKeyboard;
- using ls::atlantis::window::SdlKeyEventManager;
- using ::std::shared_ptr;
- SdlKeyEventManager::SdlKeyEventManager() = default;
- SdlKeyEventManager::~SdlKeyEventManager() = default;
- void SdlKeyEventManager::manageKeyDownEvent(const shared_ptr<IKeyboard> &_keyboard, const shared_ptr<SDL_Event> &_event)
- {
- if (_event->key.key == SDLK_ESCAPE)
- {
- _keyboard->updateKey(KeyboardKeys::ESCAPE, _keyboard->isFreed(KeyboardKeys::ESCAPE), true);
- }
- }
- void SdlKeyEventManager::manageKeyUpEvent(const shared_ptr<IKeyboard> &_keyboard, const shared_ptr<SDL_Event> &_event)
- {
- if (_event->key.key == SDLK_ESCAPE)
- {
- _keyboard->updateKey(KeyboardKeys::ESCAPE, true, _keyboard->isPressed(KeyboardKeys::ESCAPE));
- }
- }
|