Skip to content

Commit

Permalink
Tried some asynchronus input method, but doesn't seems to works
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Apr 23, 2016
1 parent 45429a8 commit 3e0171e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/Engine/Base/SDL/SDLInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ void CInput::GetInput(BOOL bPreScan)
// clear button's buffer
memset( inp_ubButtonsBuffer, 0, sizeof( inp_ubButtonsBuffer));

Uint8 *keystate = SDL_GetKeyboardState(NULL);
// for each Key
for (INDEX iKey=0; iKey<ARRAYCOUNT(_akcKeys); iKey++) {
const KeyConversion &kc = _akcKeys[iKey];
Expand All @@ -732,11 +733,11 @@ void CInput::GetInput(BOOL bPreScan)
//INDEX iScan = kc.kc_iScanCode;
INDEX iVirt = kc.kc_iVirtKey;
// if reading async keystate
if (inp_iKeyboardReadingMethod==0) {
if (0/*inp_iKeyboardReadingMethod==0*/) {
// if there is a valid virtkey
if (iVirt>=0) {
// is state is pressed
if (SDL_GetKeyboardState(NULL)[SDL_GetScancodeFromKey((SDL_Keycode)iVirt)]) {
if (keystate[SDL_GetScancodeFromKey((SDL_Keycode)iVirt)]) {
// mark it as pressed
inp_ubButtonsBuffer[iKID] = 0xFF;
}
Expand Down

0 comments on commit 3e0171e

Please sign in to comment.