From 78e9eddfb6bfbc6b103fc60c9831b23ef252886b Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Tue, 8 Jul 2025 09:56:40 -0700 Subject: core: use new typed signals from hu (#10853) --- src/managers/input/InputMethodRelay.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/managers/input/InputMethodRelay.cpp') diff --git a/src/managers/input/InputMethodRelay.cpp b/src/managers/input/InputMethodRelay.cpp index 40c87f95..c09d0624 100644 --- a/src/managers/input/InputMethodRelay.cpp +++ b/src/managers/input/InputMethodRelay.cpp @@ -11,9 +11,9 @@ CInputMethodRelay::CInputMethodRelay() { static auto P = g_pHookSystem->hookDynamic("keyboardFocus", [&](void* self, SCallbackInfo& info, std::any param) { onKeyboardFocus(std::any_cast>(param)); }); - m_listeners.newTIV3 = PROTO::textInputV3->m_events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast>(ti)); }); - m_listeners.newTIV1 = PROTO::textInputV1->m_events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast>(ti)); }); - m_listeners.newIME = PROTO::ime->m_events.newIME.registerListener([this](std::any ime) { onNewIME(std::any_cast>(ime)); }); + m_listeners.newTIV3 = PROTO::textInputV3->m_events.newTextInput.listen([this](const auto& input) { onNewTextInput(input); }); + m_listeners.newTIV1 = PROTO::textInputV1->m_events.newTextInput.listen([this](const auto& input) { onNewTextInput(input); }); + m_listeners.newIME = PROTO::ime->m_events.newIME.listen([this](const auto& ime) { onNewIME(ime); }); } void CInputMethodRelay::onNewIME(SP pIME) { @@ -27,7 +27,7 @@ void CInputMethodRelay::onNewIME(SP pIME) { m_inputMethod = pIME; - m_listeners.commitIME = pIME->m_events.onCommit.registerListener([this](std::any d) { + m_listeners.commitIME = pIME->m_events.onCommit.listen([this] { const auto PTI = getFocusedTextInput(); if (!PTI) { @@ -38,7 +38,7 @@ void CInputMethodRelay::onNewIME(SP pIME) { PTI->updateIMEState(m_inputMethod.lock()); }); - m_listeners.destroyIME = pIME->m_events.destroy.registerListener([this](std::any d) { + m_listeners.destroyIME = pIME->m_events.destroy.listen([this] { const auto PTI = getFocusedTextInput(); Debug::log(LOG, "IME Destroy"); @@ -49,9 +49,8 @@ void CInputMethodRelay::onNewIME(SP pIME) { m_inputMethod.reset(); }); - m_listeners.newPopup = pIME->m_events.newPopup.registerListener([this](std::any d) { - m_inputMethodPopups.emplace_back(makeUnique(std::any_cast>(d))); - + m_listeners.newPopup = pIME->m_events.newPopup.listen([this](const SP& popup) { + m_inputMethodPopups.emplace_back(makeUnique(popup)); Debug::log(LOG, "New input popup"); }); -- cgit v1.2.3