From 343d23d24b99b8675e7a0e73a7825ec7683a259e Mon Sep 17 00:00:00 2001 From: Piotr Krupa Date: Wed, 24 Mar 2021 16:26:54 +0100 Subject: [PATCH] Add support for Caps Lock --- include/Hry/System/Keyboard.hpp | 1 + src/Events/Proxies/WndProcEventProxy.cpp | 1 + src/KeyBinding/BindableKeys.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/include/Hry/System/Keyboard.hpp b/include/Hry/System/Keyboard.hpp index 6193cd3..b279503 100644 --- a/include/Hry/System/Keyboard.hpp +++ b/include/Hry/System/Keyboard.hpp @@ -129,6 +129,7 @@ struct Keyboard BrowserSearch, BrowserFavorites, BrowserHome, + Capital, KeyCount }; diff --git a/src/Events/Proxies/WndProcEventProxy.cpp b/src/Events/Proxies/WndProcEventProxy.cpp index ba4c843..d435f9a 100644 --- a/src/Events/Proxies/WndProcEventProxy.cpp +++ b/src/Events/Proxies/WndProcEventProxy.cpp @@ -76,6 +76,7 @@ Keyboard::Key vkKeyCodeToEnum(WPARAM key, LPARAM flags) noexcept case '7': return Key::Num7; case '8': return Key::Num8; case '9': return Key::Num9; + case VK_CAPITAL: return Key::Capital; case VK_LWIN: return Key::LSystem; case VK_RWIN: return Key::RSystem; case VK_APPS: return Key::Menu; diff --git a/src/KeyBinding/BindableKeys.cpp b/src/KeyBinding/BindableKeys.cpp index 25ff23a..d103092 100644 --- a/src/KeyBinding/BindableKeys.cpp +++ b/src/KeyBinding/BindableKeys.cpp @@ -120,6 +120,7 @@ static const auto BindableKeys = std::array{ BindableKey{ Keyboard::Key::BrowserSearch, "Search" }, BindableKey{ Keyboard::Key::BrowserFavorites, "Favorites" }, BindableKey{ Keyboard::Key::BrowserHome, "Home" }, + BindableKey{ Keyboard::Key::Capital, "Caps Lock" }, // Mouse BindableKey{ Mouse::Button::Left, "Left Mouse Button" },