Skip to content

Commit

Permalink
Just minor clarification of INPUT sizing so that its easier to remember
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemason committed Sep 9, 2022
1 parent 679356a commit 87960ce
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/headers/Platform_Windows.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,13 @@ void Platform::simulateKeyboardInput(int abbreviationLength, std::string toSend)
UnhookWindowsHookEx(keyboardHook);
HKL kbl = GetKeyboardLayout(0);

INPUT inputs[2 * ABBREVIATION_MAX_SIZE + 4 * EXPAND_MAX_SIZE] = {};
int inputCount = 0;

// key up + key down & room for shift up+ shift down
const int maximumPossibleSendInputs = 4 * EXPAND_MAX_SIZE;
const int backSpacesRequired = 2 * ABBREVIATION_MAX_SIZE; // key up + key down for each

INPUT inputs[backSpacesRequired + maximumPossibleSendInputs] = {};
int inputCount = 0;

// send a backspace for each character in our abbreviation
for (int i = 0; i < abbreviationLength; i++)
Expand Down

0 comments on commit 87960ce

Please sign in to comment.