Fixed timing of memcpy of keys to keysLast #86

Merged
mushgunAX merged 1 commits from SP3-10-input-management into main 2022-10-14 01:54:21 +08:00
1 changed files with 4 additions and 4 deletions
Showing only changes of commit 288f58c978 - Show all commits

View File

@ -44,6 +44,9 @@ namespace SHADE
void SHInputManager::UpdateInput(double dt) noexcept
{
//Keyboard and Mouse Buttons////////////////////////////////////////////////
//Write to lastKeys
memcpy(keysLast, keys, sizeof(keys));
//Poll
unsigned char keyboardState[MAX_KEYS];
//if (GetKeyboardState(keyboardState) == false) return;
@ -96,9 +99,6 @@ namespace SHADE
}
}
//Write to lastKeys
memcpy(keysLast, keys, sizeof(keys));
//Mouse Positioning/////////////////////////////////////
//https://stackoverflow.com/a/6423739