Switched to using the RawInput API for keyboard state.