So, I had an issue where my keyboard input wouldn't work, and after much looking back over the videos and debugging, I found that my controller button processing was killing my keyboard updates. Did I miss something where Casey handled this? Basically, When I press the down key, the key state gets set like it should, then my code continues down and does Win32ProcessXInputDigitalButton on the A button of the non-existent game pad. This then clears the state that was set by the keyboard. My two input processing functions:
| internal void win32ProcessXInputDigitalButton(DWORD buttonState, GameButtonState *oldState, DWORD buttonBit, GameButtonState *newState)
{
newState->endedDown = ((buttonState & buttonBit) == buttonBit);
newState->halfTransitionCount = (oldState->endedDown != newState->endedDown) ? 1 : 0;
}
internal void win32ProcessKeyboardMessage(GameButtonState *newState, bool32 isDown)
{
newState->endedDown = isDown;
newState->halfTransitionCount++;
}
|