mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 02:20:25 +01:00
Tried some asynchronus input method, but doesn't seems to works
This commit is contained in:
parent
45429a88d8
commit
3e0171ea1b
|
@ -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];
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user