From e2ff6a4b405bf7b7d927e0ac87b50e340466f7d5 Mon Sep 17 00:00:00 2001 From: aegiMt Date: Tue, 20 Jun 2017 07:31:23 +0200 Subject: [PATCH] Update HidInject.cpp Fix issue when injecting 2 or more keys at same time. --- HIDInjector/app/HidInject.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/HIDInjector/app/HidInject.cpp b/HIDInjector/app/HidInject.cpp index cf9e8d8ec..f2ba3da13 100644 --- a/HIDInjector/app/HidInject.cpp +++ b/HIDInjector/app/HidInject.cpp @@ -325,11 +325,11 @@ BOOL SetKeybaordUsage(HIDINJECTOR_INPUT_REPORT *Rep, UCHAR Usage) } else if (Rep->Report.KeyReport.Key3 == 0) { - Rep->Report.KeyReport.Key2 = Usage; + Rep->Report.KeyReport.Key3 = Usage; } else if (Rep->Report.KeyReport.Key4 == 0) { - Rep->Report.KeyReport.Key2 = Usage; + Rep->Report.KeyReport.Key4 = Usage; } else { @@ -359,18 +359,18 @@ BOOL ClearKeyboardUsage(HIDINJECTOR_INPUT_REPORT *Rep, UCHAR Usage) { Rep->Report.KeyReport.Key4 = 0; } - if (Rep->Report.KeyReport.Key3 == Usage) + else if (Rep->Report.KeyReport.Key3 == Usage) { Rep->Report.KeyReport.Key3 = Rep->Report.KeyReport.Key4; Rep->Report.KeyReport.Key4 = 0; } - if (Rep->Report.KeyReport.Key2 == Usage) + else if (Rep->Report.KeyReport.Key2 == Usage) { Rep->Report.KeyReport.Key2 = Rep->Report.KeyReport.Key3; Rep->Report.KeyReport.Key3 = Rep->Report.KeyReport.Key4; Rep->Report.KeyReport.Key4 = 0; } - if (Rep->Report.KeyReport.Key1 == Usage) + else if (Rep->Report.KeyReport.Key1 == Usage) { Rep->Report.KeyReport.Key1 = Rep->Report.KeyReport.Key2; Rep->Report.KeyReport.Key2 = Rep->Report.KeyReport.Key3; @@ -389,4 +389,4 @@ BOOL ClearKeyboardUsage(HIDINJECTOR_INPUT_REPORT *Rep, UCHAR Usage) } return TRUE; -} \ No newline at end of file +}