[client/idd] input: wait for valid keyboard LED feedback

Do not publish the default all-off LED value until Windows supplies a
real HID output report. Treat the first all-off report as valid and
retain known state across pipe reconnects.

Serialize feedback processing with connection invalidation so a stale
message cannot restore validity after disconnect.
This commit is contained in:
Geoffrey McRae
2026-08-21 13:55:15 +10:00
parent 7ca94e8959
commit efb397bbaf
3 changed files with 23 additions and 13 deletions

View File

@@ -50,13 +50,14 @@ private:
CPipeEndpoint m_endpoint;
CSRWLock m_feedbackLock;
bool m_feedbackReady = false;
uint64_t m_feedbackSequence = 0;
uint8_t m_keyboardLEDs = 0;
uint64_t m_lastSequence = 0;
uint64_t m_statReceived = 0;
uint64_t m_statMalformed = 0;
uint64_t m_statSequenceResets = 0;
uint64_t m_statSubmitFailed = 0;
ULONGLONG m_lastStatistics = 0;
bool m_feedbackReady = false;
bool m_keyboardLEDsValid = false;
uint64_t m_feedbackSequence = 0;
uint8_t m_keyboardLEDs = 0;
uint64_t m_lastSequence = 0;
uint64_t m_statReceived = 0;
uint64_t m_statMalformed = 0;
uint64_t m_statSequenceResets = 0;
uint64_t m_statSubmitFailed = 0;
ULONGLONG m_lastStatistics = 0;
};