This commit is contained in:
Branimir Karadžić
2017-01-23 09:42:10 -08:00
parent 19770a8f20
commit 82ec67105f
2 changed files with 3 additions and 2 deletions

View File

@@ -143,13 +143,14 @@ namespace entry
}
WindowHandle defaultWindow = { 0 };
GamepadHandle handle = { 0 };
for (uint32_t ii = 0; ii < BX_COUNTOF(m_state); ++ii)
{
XINPUT_STATE state;
DWORD result = XInputGetState(ii, &state);
GamepadHandle handle = { ii };
bool connected = ERROR_SUCCESS == result;
if (connected != m_connected[ii])
{

View File

@@ -85,7 +85,7 @@ struct InputKeyboard
static uint32_t encodeKeyState(uint8_t _modifiers, bool _down)
{
uint32_t state = 0;
state |= uint32_t(_modifiers)<<16;
state |= uint32_t(_down ? _modifiers : 0)<<16;
state |= uint32_t(_down)<<8;
return state;
}