diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-02 16:12:51 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-02 22:35:38 +0200 |
commit | dce44862c64f50411a4f09713382b60a0e904d92 (patch) | |
tree | ce83a796b3c57bba65b56daa3694713dd4c2fc4e /editor | |
parent | f986add6f37dfe347d59d3c4d8bd9744935bd400 (diff) |
editor: silence unhandled event message on modifier keypress
Diffstat (limited to 'editor')
-rw-r--r-- | editor/events.cpp | 15 | ||||
-rw-r--r-- | editor/update.cpp | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/editor/events.cpp b/editor/events.cpp index a69d0e65..d559022c 100644 --- a/editor/events.cpp +++ b/editor/events.cpp @@ -113,6 +113,21 @@ auto app::resolve_keybinding(int k_, int mods_) -> std::tuple<key, int> [[maybe_unused]] constexpr int ALT = kmod_alt; [[maybe_unused]] constexpr int SUPER = kmod_super; + switch (k_) + { + case SDLK_LSHIFT: + case SDLK_RSHIFT: + case SDLK_LCTRL: + case SDLK_RCTRL: + case SDLK_LALT: + case SDLK_RALT: + case SDLK_LGUI: + case SDLK_RGUI: + return { key_noop, kmod_mask }; + default: + break; + } + const int k = k_ | fixup_mods(mods_); constexpr kmod list[] = { kmod_none, kmod_super, kmod_alt, kmod_shift, kmod_ctrl, }; int last = ~0; diff --git a/editor/update.cpp b/editor/update.cpp index 2311d478..d90023b7 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -178,6 +178,8 @@ void app::do_key(key k, int mods) if (k >= key_NO_REPEAT) fm_warn("unhandled key: '%zu'", size_t(k)); return; + case key_noop: + return; case key_rotate_tile: return do_rotate(false); case key_emit_timestamp: |