From 9e15e883f619f31d75079b4da7fe6ab069777a56 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Mon, 13 Oct 2025 11:11:11 +0200 Subject: [PATCH] Fix issue where only first bound button was considered --- openVulkanoCpp/Input/InputManager.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/openVulkanoCpp/Input/InputManager.cpp b/openVulkanoCpp/Input/InputManager.cpp index f9b68c6..05ac989 100644 --- a/openVulkanoCpp/Input/InputManager.cpp +++ b/openVulkanoCpp/Input/InputManager.cpp @@ -69,7 +69,7 @@ namespace OpenVulkano::Input for (const KeyBinding binding : action->GetKeys()) { if (binding.key.GetInputDeviceType() != device->GetType()) continue; - return device->GetButton(binding.key); + if (device->GetButton(binding.key)) return true; } } return false; @@ -82,11 +82,8 @@ namespace OpenVulkano::Input { for (const KeyBinding binding : action->GetKeys()) { - if (binding.key.GetInputDeviceType() != device->GetType()) - { - continue; - } - return device->GetButtonDown(binding.key); + if (binding.key.GetInputDeviceType() != device->GetType()) continue; + if (device->GetButtonDown(binding.key)) return true; } } return false; @@ -99,11 +96,8 @@ namespace OpenVulkano::Input { for (const KeyBinding binding : action->GetKeys()) { - if (binding.key.GetInputDeviceType() != device->GetType()) - { - continue; - } - return device->GetButtonUp(binding.key); + if (binding.key.GetInputDeviceType() != device->GetType()) continue; + if (device->GetButtonUp(binding.key)) return true; } } return false; @@ -114,7 +108,7 @@ namespace OpenVulkano::Input for(const InputDevice* device : devices) { if (key.GetInputDeviceType() != device->GetType()) continue; - return device->GetButton(key); + if (device->GetButton(key)) return true; } return false; } @@ -124,7 +118,7 @@ namespace OpenVulkano::Input for(const InputDevice* device : devices) { if (key.GetInputDeviceType() != device->GetType()) continue; - return device->GetButtonUp(key); + if (device->GetButtonUp(key)) return true; } return false; } @@ -134,7 +128,7 @@ namespace OpenVulkano::Input for(const InputDevice* device : devices) { if (key.GetInputDeviceType() != device->GetType()) continue; - return device->GetButtonDown(key); + if (device->GetButtonDown(key)) return true; } return false; }