I have a Logitech Wingman Cordless that fails with his example.
*** Here is a DBProInputDebug.dll "attached" that I believe fix's this issue ***
NOTE: !!! Please save your original DBProInputDebug.dll first !!! Thanks
But use it for testing purposes only or use it at your own risk if you want to use for your game. I don't know if there is any side effects because I don't know Lee's coding design 100%.
------------------------------------------------------------------
C++ Changes:
------------------------------------------------------------------
Again, in CInputC.cpp file from the DBPro's Google Source Code,
Inside function:
PerformChecklistControlDevices
I put:
GlobExpandChecklist(0, g_dwMaxStringSizeInEnum);
In Front of the first EnumDevices line:
hRes = m_lpDI->EnumDevices ( DI8DEVCLASS_GAMECTRL, (LPDIENUMDEVICESCALLBACK)ChecklistInputControllers, NULL, DIEDFL_ATTACHEDONLY);
DARKSDK void PerformChecklistControlDevices( void )
{
HRESULT hRes;
// Generate Checklist
if(g_pGlob)
{
g_pGlob->checklistqty=0;
g_pGlob->checklisthasvalues=true;
g_pGlob->checklisthasstrings=true;
g_bCreateChecklistNow=false;
GlobExpandChecklist(0, g_dwMaxStringSizeInEnum);
hRes = m_lpDI->EnumDevices ( DI8DEVCLASS_GAMECTRL, (LPDIENUMDEVICESCALLBACK)ChecklistInputControllers, NULL, DIEDFL_ATTACHEDONLY);
// Ensure checklist is large enough
for(int c=0; c<g_pGlob->checklistqty; c++)
GlobExpandChecklist(c, g_dwMaxStringSizeInEnum);
g_pGlob->checklistqty=0;
g_bCreateChecklistNow=true;
hRes = m_lpDI->EnumDevices ( DI8DEVCLASS_GAMECTRL, (LPDIENUMDEVICESCALLBACK)ChecklistInputControllers, NULL, DIEDFL_ATTACHEDONLY);
if(hRes==DI_OK)
{
// Additionally overwrite capability flags if any devices are forcefeedback..
m_lpDI->EnumDevices ( DI8DEVCLASS_GAMECTRL, (LPDIENUMDEVICESCALLBACK)ChecklistAddFFValueFlag, NULL, DIEDFL_ATTACHEDONLY | DIEDFL_FORCEFEEDBACK);
// Checklist is valid
g_pGlob->checklistexists=true;
}
else
g_pGlob->checklistexists=false;
}
}
One more thing, with DBPro's SET CONTROL DEVICE command, it will do a runtime error saying it cannot find a device in which it will exit the program. We don't want that.
So, in the that same C++ file in the function:
SetControlDeviceEx
I remarked out the runtime error like so:
//RunTimeError(RUNTIMEERROR_INPUTCONTROLLERNOTAVAIL);
DARKSDK void SetControlDeviceEx( DWORD pName, int iSubIndex )
{
// find this controller
strcpy(gFindController, (LPSTR)pName);
// use subindex (0-default, 1-skips first occurance of name)
giChoseSameControllerByIndex = iSubIndex;
// call find routine
if(!DB_SelectNewControlDevice())
{
//RunTimeError(RUNTIMEERROR_INPUTCONTROLLERNOTAVAIL);
}
}
------------------------------------------------------------------
DBPro Test Code:
------------------------------------------------------------------
Here's the DBPro test code I used.
checklist value a(c) never returns a 1 for me so I don't use that.
This code also constantly checks for a device. So plugin and unplug a lot in different ways to see if it works for you. Thanks
GLOBAL quantity as INTEGER
Do
cls 0
Input_DefaultController()
text 10, 10, "Number of Devices:"+str$(quantity)
text 10, 20, CONTROL DEVICE NAME$()
For i = 0 to 30
text 10, 30+(i*10), Str$(JoyStick Information(i))
Next i
sync
loop
Function Input_DefaultController()
empty checklist
PERFORM CHECKLIST FOR CONTROL DEVICES
quantity = checklist quantity()
for c=1 to quantity
SET CONTROL DEVICE checklist string$(c)
next c
EndFunction