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


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

本文整理汇总了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;
}
开发者ID:branan,项目名称:Plasma-nobink,代码行数:36,代码来源:plInputManager.cpp

示例2: BuildActionMap

 HRESULT _stdcall BuildActionMap(LPDIACTIONFORMATA a,LPCSTR b,DWORD c) { return RealDevice->BuildActionMap(a,b,c); }
开发者ID:679565,项目名称:SkyrimOnline,代码行数:1,代码来源:Hooks_DirectInput8Create.cpp


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