input: fix keyboard leds with multiple keyboards (#7079)

This commit is contained in:
Sungyoon Cho 2024-07-28 19:46:38 +09:00 committed by GitHub
parent bc86afea7e
commit 9b6ae4f77b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 16 deletions

View file

@ -1265,7 +1265,14 @@ void CInputManager::updateKeyboardsLeds(SP<IKeyboard> pKeyboard) {
if (!pKeyboard)
return;
pKeyboard->updateLEDs();
std::optional<uint32_t> leds = pKeyboard->getLEDs();
if (!leds.has_value())
return;
for (auto& k : m_vKeyboards) {
k->updateLEDs(leds.value());
}
}
void CInputManager::onKeyboardKey(std::any event, SP<IKeyboard> pKeyboard) {