From e938acb846807568481068c9338144e0314a15da Mon Sep 17 00:00:00 2001 From: ladevieq Date: Thu, 5 Aug 2021 20:33:35 +0200 Subject: Fix modifiers key on windows --- include/window.hpp | 8 ++++---- src/main.cpp | 2 +- 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, -- cgit v1.3