diff options
author | crupest <crupest@outlook.com> | 2020-03-29 23:29:01 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-03-29 23:29:01 +0800 |
commit | 725d296ff1d58451010295b2dff1a95a18623c44 (patch) | |
tree | bb6b58d2a9e6f4fd37f4310b982b08480f27982c /src/win/native/keyboard.cpp | |
parent | 85322feaa9f646bf9e6f35f57f6d08244b298a46 (diff) | |
download | cru-725d296ff1d58451010295b2dff1a95a18623c44.tar.gz cru-725d296ff1d58451010295b2dff1a95a18623c44.tar.bz2 cru-725d296ff1d58451010295b2dff1a95a18623c44.zip |
...
Diffstat (limited to 'src/win/native/keyboard.cpp')
-rw-r--r-- | src/win/native/keyboard.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/win/native/keyboard.cpp b/src/win/native/keyboard.cpp index b73d0ffb..98a95778 100644 --- a/src/win/native/keyboard.cpp +++ b/src/win/native/keyboard.cpp @@ -63,4 +63,12 @@ KeyCode VirtualKeyToKeyCode(int virtual_key) { } } } + +KeyModifier RetrieveKeyMofifier() { + KeyModifier result{0}; + if (::GetKeyState(VK_SHIFT) < 0) result |= key_modifiers::shift; + if (::GetKeyState(VK_CONTROL) < 0) result |= key_modifiers::ctrl; + if (::GetKeyState(VK_MENU) < 0) result |= key_modifiers::alt; + return result; +} } // namespace cru::platform::native::win |