Hi PjCast,
As a quick test I hacked together a new version of Win32JoyStick::capture() that used GetDeviceState rather than GetDeviceData, but it still shows the same behaviour - i.e. odd values until the wheel or pedals are moved.
void Win32JoyStick::capture()
{
#ifdef OIS_WIN32_XINPUT_SUPPORT
//handle xbox controller differently
if (mJoyInfo.isXInput)
{
captureXInput();
return;
}
#endif
//handle directinput based devices
DIDEVICEOBJECTDATA diBuff[JOYSTICK_DX_BUFFERSIZE];
DWORD entries = JOYSTICK_DX_BUFFERSIZE;
DIJOYSTATE2 state;
// Poll the device to read the current state
HRESULT hr = mJoyStick->Poll();
if( hr == DI_OK )
hr = mJoyStick->GetDeviceData( sizeof(DIDEVICEOBJECTDATA), diBuff, &entries, 0 );
if( hr != DI_OK )
{
hr = mJoyStick->Acquire();
while( hr == DIERR_INPUTLOST )
hr = mJoyStick->Acquire();
// Poll the device to read the current state
mJoyStick->Poll();
hr = mJoyStick->GetDeviceData( sizeof(DIDEVICEOBJECTDATA), diBuff, &entries, 0 );
//Perhaps the user just tabbed away
if( FAILED(hr) )
return;
}
hr = mJoyStick->GetDeviceState(sizeof(DIJOYSTATE2), &state);
mState.mAxes[0].abs = state.lX;
mState.mAxes[1].abs = state.lY;
mState.mAxes[2].abs = state.lZ;
mState.mAxes[3].abs = state.lRx;
mState.mAxes[4].abs = state.lRy;
mState.mAxes[5].abs = state.lRz;
I know there is redundant code and sliders / POVs etc aren't handled, but I just wanted to check if GetDeviceState would help.
I have tried to contact logitech on their consumer forum, but no response as yet. I've signed up to their developer portal too, but no response yet. If I hear anything I'll report back
All the best,
Ash