本文整理汇总了C++中IDirectInputDevice8::BuildActionMap方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectInputDevice8::BuildActionMap方法的具体用法?C++ IDirectInputDevice8::BuildActionMap怎么用?C++ IDirectInputDevice8::BuildActionMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDirectInputDevice8
的用法示例。
在下文中一共展示了IDirectInputDevice8::BuildActionMap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnumGamepadCallback
// enumerate the dinput devices
int __stdcall plDInputMgr::EnumGamepadCallback(const DIDEVICEINSTANCE* device, void* pRef)
{
HRESULT hr;
plDInput* pDI = (plDInput*)pRef;
IDirectInputDevice8* fStick = nil;
hr = pDI->fDInput->CreateDevice(device->guidInstance, &fStick, NULL);
if(!FAILED(hr))
{
pDI->fSticks.Append(new plDIDevice(fStick));
// the following code pertaining to the action map shouldn't be here.
// in fact this shouldn't work at all according to MS, but this is
// currently the only way this works. Whatever - the correct
// code is here and commented out in case this ever gets fixed by MS
// in a future release of dinput.
HRESULT hr = fStick->BuildActionMap(pDI->fActionFormat, NULL, NULL);
if (!FAILED(hr))
{
hr = fStick->SetActionMap( pDI->fActionFormat, NULL, NULL );
DIPROPDWORD dipW;
dipW.diph.dwSize = sizeof(DIPROPDWORD);
dipW.diph.dwHeaderSize = sizeof(DIPROPHEADER);
dipW.diph.dwHow = DIPH_DEVICE;
dipW.diph.dwObj = 0;
dipW.dwData = 500; // 5% of axis range for deadzone
hr = fStick->SetProperty(DIPROP_DEADZONE , &dipW.diph);
}
return DIENUM_CONTINUE;
}
return DIENUM_STOP;
}
示例2: BuildActionMap
HRESULT _stdcall BuildActionMap(LPDIACTIONFORMATA a,LPCSTR b,DWORD c) { return RealDevice->BuildActionMap(a,b,c); }