当前位置: 首页>>代码示例>>C++>>正文


C++ LPDIRECTINPUTDEVICE8::BuildActionMap方法代码示例

本文整理汇总了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;

}
开发者ID:lfzawacki,项目名称:dinput-samples,代码行数:29,代码来源:devices_test.cpp

示例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
开发者ID:0xrofi,项目名称:Aquaplus,代码行数:22,代码来源:keyInput.cpp

示例3: BuildActionMap

 HRESULT _stdcall BuildActionMap(LPDIACTIONFORMATW a,LPCWSTR b,DWORD c) {
     return RealDevice->BuildActionMap(a,b,c);
 }
开发者ID:europop,项目名称:morrgraphext,代码行数:3,代码来源:DInput+(mouse+combat).cpp


注:本文中的LPDIRECTINPUTDEVICE8::BuildActionMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。