[QuickAccent] Fix on-screen keyboard activation (#37581)

* fix on-screen keyboard activation

* cleanup
This commit is contained in:
Davide Giacometti
2025-04-16 05:08:43 +02:00
committed by GitHub
parent a16f784011
commit e700f86ace

View File

@@ -169,6 +169,14 @@ namespace winrt::PowerToys::PowerAccentKeyboardService::implementation
if (std::find(letters.begin(), letters.end(), letterKey) != cend(letters) && m_isLanguageLetterCb(letterKey)) if (std::find(letters.begin(), letters.end(), letterKey) != cend(letters) && m_isLanguageLetterCb(letterKey))
{ {
if (m_toolbarVisible && letterPressed == letterKey)
{
// On-screen keyboard continuously sends WM_KEYDOWN when a key is held down
// If Quick Accent is visible, prevent the letter key from being processed
// https://github.com/microsoft/PowerToys/issues/36853
return true;
}
m_stopwatch.reset(); m_stopwatch.reset();
letterPressed = letterKey; letterPressed = letterKey;
} }
@@ -281,7 +289,6 @@ namespace winrt::PowerToys::PowerAccentKeyboardService::implementation
} }
LRESULT KeyboardListener::LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) LRESULT KeyboardListener::LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
{
{ {
if (nCode == HC_ACTION && s_instance != nullptr) if (nCode == HC_ACTION && s_instance != nullptr)
{ {
@@ -310,4 +317,3 @@ namespace winrt::PowerToys::PowerAccentKeyboardService::implementation
return CallNextHookEx(NULL, nCode, wParam, lParam); return CallNextHookEx(NULL, nCode, wParam, lParam);
} }
} }
}