本文整理汇总了C++中LPDIRECTINPUTDEVICE8::BuildActionMap方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTINPUTDEVICE8::BuildActionMap方法的具体用法?C++ LPDIRECTINPUTDEVICE8::BuildActionMap怎么用?C++ LPDIRECTINPUTDEVICE8::BuildActionMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECTINPUTDEVICE8
的用法示例。
在下文中一共展示了LPDIRECTINPUTDEVICE8::BuildActionMap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printf
BOOL CALLBACK EnumSemanticsCallback //Callback function that receive DirectInput devices
( LPCDIDEVICEINSTANCE lpddi, //Adress of structure describing device instance
LPDIRECTINPUTDEVICE8 lpdid, //Pointer to device interface
DWORD dwFlags, //Flags telling why being enumerated
DWORD dwRemaining, //Number of devices remaining to be enumerated
LPVOID pvRef) //Application defined value. Always NULL here
{
HRESULT hr;
if (GET_DIDEVICE_TYPE(lpddi->dwDevType) == DI8DEVTYPE_MOUSE ||
GET_DIDEVICE_TYPE(lpddi->dwDevType) == DI8DEVTYPE_KEYBOARD
)
return DIENUM_CONTINUE;
printf("Device %s\n",lpddi->tszProductName);
#define X(x) if (dwFlags & x) printf("\tdwFlags |= "#x"\n");
X(DIEDBS_MAPPEDPRI1)
X(DIEDBS_MAPPEDPRI2)
X(DIEDBS_RECENTDEVICE)
X(DIEDBS_NEWDEVICE)
#undef X
hr = lpdid->BuildActionMap(&g_ActionFormat,NULL,DIDBAM_INITIALIZE);
_dump_diactionformatA(&g_ActionFormat);
return DIENUM_CONTINUE;
}
示例2: EnumDevicesBySemanticsCallback
BOOL CALLBACK EnumDevicesBySemanticsCallback(
LPCDIDEVICEINSTANCE lpddi, LPDIRECTINPUTDEVICE8 lpdid,
DWORD dwFlags, DWORD dwRemaining, LPVOID pvRef)
{
HRESULT hr;
hr = lpdid->BuildActionMap(&g_DIActionFormat, NULL, DIDBAM_INITIALIZE );
if (FAILED(hr)){
return DIENUM_CONTINUE;
}
hr = lpdid->SetActionMap(&g_DIActionFormat, NULL, DIDSAM_DEFAULT);
if (FAILED(hr)){
return DIENUM_CONTINUE;
}
hr = lpdid->SetCooperativeLevel(sysInf.hWnd,DISCL_NONEXCLUSIVE | DISCL_FOREGROUND);
lpdid->AddRef();
g_pDIDevice[g_iDIDeviceNum++] = lpdid;
if (MAX_DEV <= g_iDIDeviceNum)
DIENUM_STOP;
return DIENUM_CONTINUE;
} // EnumDevicesBySemanticsCallback
示例3: BuildActionMap
HRESULT _stdcall BuildActionMap(LPDIACTIONFORMATW a,LPCWSTR b,DWORD c) {
return RealDevice->BuildActionMap(a,b,c);
}