diff options
Diffstat (limited to 'src/managers/input/InputMethodRelay.cpp')
| -rw-r--r-- | src/managers/input/InputMethodRelay.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
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<SP<CWLSurfaceResource>>(param)); }); - m_listeners.newTIV3 = PROTO::textInputV3->m_events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast<WP<CTextInputV3>>(ti)); }); - m_listeners.newTIV1 = PROTO::textInputV1->m_events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast<WP<CTextInputV1>>(ti)); }); - m_listeners.newIME = PROTO::ime->m_events.newIME.registerListener([this](std::any ime) { onNewIME(std::any_cast<SP<CInputMethodV2>>(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<CInputMethodV2> pIME) { @@ -27,7 +27,7 @@ void CInputMethodRelay::onNewIME(SP<CInputMethodV2> 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<CInputMethodV2> 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<CInputMethodV2> pIME) { m_inputMethod.reset(); }); - m_listeners.newPopup = pIME->m_events.newPopup.registerListener([this](std::any d) { - m_inputMethodPopups.emplace_back(makeUnique<CInputPopup>(std::any_cast<SP<CInputMethodPopupV2>>(d))); - + m_listeners.newPopup = pIME->m_events.newPopup.listen([this](const SP<CInputMethodPopupV2>& popup) { + m_inputMethodPopups.emplace_back(makeUnique<CInputPopup>(popup)); Debug::log(LOG, "New input popup"); }); |
