diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-08-05 20:33:35 +0200 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-08-05 20:33:35 +0200 |
| commit | e938acb846807568481068c9338144e0314a15da (patch) | |
| tree | 602ae919aa494c1ca92120a3a1459c01f0bfa575 | |
| parent | 75efba4a1e581f180d0dedf162eb1f1d18dc091c (diff) | |
Fix modifiers key on windows
| -rw-r--r-- | include/window.hpp | 8 | ||||
| -rw-r--r-- | src/main.cpp | 2 | ||||
| -rw-r--r-- | src/window.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/include/window.hpp b/include/window.hpp index a21a27b..07753df 100644 --- a/include/window.hpp +++ b/include/window.hpp @@ -35,8 +35,10 @@ class vkrenderer; // TODO improve this #if defined(WINDOWS) enum KEYS: uint32_t { - SHIFT = 0x10, - CTRL, + LSHIFT = 0x10, + RSHIFT = 0x10, + LCTRL = 0x11, + RCTRL = 0x11, ALT, SPACE = 0x20, A = 0x41, @@ -65,8 +67,6 @@ enum KEYS: uint32_t { X, Y, Z, - LSHIFT = 0xA0, - RSHIFT, MAX_KEYS = 255 }; #else diff --git a/src/main.cpp b/src/main.cpp index 21702db..83d460a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -153,7 +153,7 @@ int main() { move_vec = ((scene*) renderer.scene_buffer_ptr())->meta.cam.up.unit() * move_speed; break; } - case KEYS::CTRL: { + case KEYS::LCTRL: { move_vec = -((scene*) renderer.scene_buffer_ptr())->meta.cam.up.unit() * move_speed; break; } diff --git a/src/window.cpp b/src/window.cpp index 98495fd..65f8177 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -235,7 +235,7 @@ void window::poll_events() { MSG msg = {}; // Generate keydown events pressed keys - for (size_t virtual_key = KEYS::SHIFT; virtual_key < KEYS::MAX_KEYS; virtual_key++) { + for (size_t virtual_key = KEYS::LSHIFT; virtual_key < KEYS::MAX_KEYS; virtual_key++) { if (keyboard[virtual_key]) { events.push_back({ .key = (KEYS)virtual_key, |
