From 361ae19835b15eb49682eacd9eeb27843bd3617a Mon Sep 17 00:00:00 2001 From: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> Date: Sun, 17 Nov 2024 22:34:49 +0000 Subject: [PATCH] format modified: src/managers/KeybindManager.cpp modified: src/managers/KeybindManager.hpp --- src/managers/KeybindManager.cpp | 19 +++++++++---------- src/managers/KeybindManager.hpp | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index a4a81dc3ebe..a0cd01a9135 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -147,19 +147,18 @@ CKeybindManager::CKeybindManager() { m_pRepeatKeyTimer = makeShared( std::nullopt, [this](SP self, void* data) { + if (m_vActiveKeybinds.size() == 0 || g_pSeatManager->keyboard.expired()) + return; - if (m_vActiveKeybinds.size() == 0 || g_pSeatManager->keyboard.expired()) - return; - - for (SKeybind* k : m_vActiveKeybinds) { - const auto DISPATCHER = g_pKeybindManager->m_mDispatchers.find(k->handler); + for (SKeybind* k : m_vActiveKeybinds) { + const auto DISPATCHER = g_pKeybindManager->m_mDispatchers.find(k->handler); - Debug::log(LOG, "Keybind repeat triggered, calling dispatcher."); - DISPATCHER->second(k->arg); - } + Debug::log(LOG, "Keybind repeat triggered, calling dispatcher."); + DISPATCHER->second(k->arg); + } - const auto PACTIVEKEEB = g_pSeatManager->keyboard.lock(); - self->updateTimeout(std::chrono::milliseconds(1000 / PACTIVEKEEB->repeatRate)); + const auto PACTIVEKEEB = g_pSeatManager->keyboard.lock(); + self->updateTimeout(std::chrono::milliseconds(1000 / PACTIVEKEEB->repeatRate)); }, nullptr); diff --git a/src/managers/KeybindManager.hpp b/src/managers/KeybindManager.hpp index ccbbce6c6af..d375db0fd68 100644 --- a/src/managers/KeybindManager.hpp +++ b/src/managers/KeybindManager.hpp @@ -120,7 +120,7 @@ class CKeybindManager { inline static std::string m_szCurrentSelectedSubmap = ""; std::vector m_vActiveKeybinds; - SKeybind * m_pLastLongPressKeybind = nullptr; + SKeybind* m_pLastLongPressKeybind = nullptr; SP m_pLongPressTimer, m_pRepeatKeyTimer; uint32_t m_uTimeLastMs = 0;