diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index cb6559ed..19a46ea9 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -909,8 +909,12 @@ void CInputManager::setupKeyboard(SP keeb) { g_pKeybindManager->m_mKeyToCodeCache.clear(); } - g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", PKEEB->hlName + ";" + LAYOUT}); + // NOTE: This block is deprecated. + g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", PKEEB->hlName + "," + LAYOUT}); EMIT_HOOK_EVENT("activeLayout", (std::vector{PKEEB, LAYOUT})); + + g_pEventManager->postEvent(SHyprIPCEvent{"activelayoutv2", PKEEB->hlName + ";" + LAYOUT}); + EMIT_HOOK_EVENT("activeLayoutv2", (std::vector{PKEEB, LAYOUT})); }, keeb.get()); @@ -974,9 +978,13 @@ void CInputManager::applyConfigToKeyboard(SP pKeyboard) { const auto LAYOUTSTR = pKeyboard->getActiveLayout(); - g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", pKeyboard->hlName + ";" + LAYOUTSTR}); + // NOTE: This block is deprecated. + g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", pKeyboard->hlName + "," + LAYOUTSTR}); EMIT_HOOK_EVENT("activeLayout", (std::vector{pKeyboard, LAYOUTSTR})); + g_pEventManager->postEvent(SHyprIPCEvent{"activelayoutv2", pKeyboard->hlName + ";" + LAYOUTSTR}); + EMIT_HOOK_EVENT("activeLayoutv2", (std::vector{pKeyboard, LAYOUTSTR})); + Debug::log(LOG, "Set the keyboard layout to {} and variant to {} for keyboard \"{}\"", pKeyboard->currentRules.layout, pKeyboard->currentRules.variant, pKeyboard->hlName); } @@ -1341,8 +1349,12 @@ void CInputManager::onKeyboardMod(SP pKeyboard) { Debug::log(LOG, "LAYOUT CHANGED TO {} GROUP {}", LAYOUT, MODS.group); - g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", pKeyboard->hlName + ";" + LAYOUT}); + // NOTE: This block is deprecated. + g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", pKeyboard->hlName + "," + LAYOUT}); EMIT_HOOK_EVENT("activeLayout", (std::vector{pKeyboard, LAYOUT})); + + g_pEventManager->postEvent(SHyprIPCEvent{"activelayoutv2", pKeyboard->hlName + ";" + LAYOUT}); + EMIT_HOOK_EVENT("activeLayoutv2", (std::vector{pKeyboard, LAYOUT})); } }