From c77286512c0053246b731fe159697d5ae70b4b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Wed, 25 Oct 2017 18:31:52 +0200 Subject: [PATCH] Reset keyboard reports just before changing them by UpdateActiveUsbReports(). This seems to completely solve the repeated media key issue. --- right/src/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/right/src/main.c b/right/src/main.c index a3c0dc9..cf154cd 100644 --- a/right/src/main.c +++ b/right/src/main.c @@ -43,13 +43,14 @@ void UpdateUsbReports(void) return; } + KeyMatrix_Scan(&KeyMatrix); + + memcpy(CurrentKeyStates[SlotId_RightKeyboardHalf], KeyMatrix.keyStates, MAX_KEY_COUNT_PER_MODULE); + ResetActiveUsbBasicKeyboardReport(); ResetActiveUsbMediaKeyboardReport(); ResetActiveUsbSystemKeyboardReport(); - KeyMatrix_Scan(&KeyMatrix); - - memcpy(CurrentKeyStates[SlotId_RightKeyboardHalf], KeyMatrix.keyStates, MAX_KEY_COUNT_PER_MODULE); UpdateActiveUsbReports(); SwitchActiveUsbBasicKeyboardReport();