diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-17 14:19:09 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-17 14:19:09 +0100 |
commit | c96ef5f62a1369d66e8eba9bf8ed192e3cf8e716 (patch) | |
tree | 6b9c058ede31635e50287e3f9dbbe2fddca4c63d | |
parent | 6d2174db28992b49ea266c653f6283c61ef071f0 (diff) |
add noexcept qualifier to Script::get_key_state
-rw-r--r-- | src/crepe/api/Script.cpp | 2 | ||||
-rw-r--r-- | src/crepe/api/Script.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/crepe/api/Script.cpp b/src/crepe/api/Script.cpp index d4eaae9..583c04f 100644 --- a/src/crepe/api/Script.cpp +++ b/src/crepe/api/Script.cpp @@ -31,7 +31,7 @@ const keyboard_state_t & Script::get_keyboard_state() const { return sdl_context.get_keyboard_state(); } -bool Script::get_key_state(Keycode key) const { +bool Script::get_key_state(Keycode key) const noexcept { try { return this->get_keyboard_state().at(key); } catch (...) { diff --git a/src/crepe/api/Script.h b/src/crepe/api/Script.h index b5d3dd2..65306cd 100644 --- a/src/crepe/api/Script.h +++ b/src/crepe/api/Script.h @@ -150,7 +150,7 @@ protected: * \return Keycode state (true if pressed, false if not pressed). * */ - bool get_key_state(Keycode key) const; + bool get_key_state(Keycode key) const noexcept; //! \} private: |