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


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

本文整理汇总了C++中LPDIRECTINPUTDEVICE8::Escape方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTINPUTDEVICE8::Escape方法的具体用法?C++ LPDIRECTINPUTDEVICE8::Escape怎么用?C++ LPDIRECTINPUTDEVICE8::Escape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LPDIRECTINPUTDEVICE8的用法示例。


在下文中一共展示了LPDIRECTINPUTDEVICE8::Escape方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: WriteAdaptoidPak

HRESULT WriteAdaptoidPak( LPDIRECTINPUTDEVICE8 lpDirectInputDevice, DWORD addr, LPBYTE data )
{
    DIEFFESCAPE esc;
    struct
    {
        DWORD addr;
        BYTE data[32];
    } buf;

    buf.addr = addr;
    CopyMemory( buf.data, data, 32 );

    esc.dwSize = sizeof(esc);
    esc.dwCommand = ADAPT_WRITEPAK;   // Write 32 bytes to pak
    esc.lpvInBuffer = &buf;
    esc.cbInBuffer = 36;
    esc.lpvOutBuffer = NULL;   
    esc.cbOutBuffer = 0;
	
	HRESULT hr = lpDirectInputDevice->Escape(&esc);

#ifdef _DEBUG
	LPCSTR suc = (SUCCEEDED(hr)) ? "OK" : "FAILED";

	DebugWriteA( "Direct Adaptoid WritePak(Addr:%04X): %s (RC:%08X)\n", addr, suc, hr );
#endif // #ifdef _DEBUG

    return hr;
}
开发者ID:Anonymous2,项目名称:project64,代码行数:29,代码来源:DirectInput.cpp

示例2: InitializeAdaptoid

HRESULT InitializeAdaptoid( LPDIRECTINPUTDEVICE8 lpDirectInputDevice, LPBYTE status )
{
    DIEFFESCAPE esc;

    esc.dwSize = sizeof(esc);
    esc.dwCommand = ADAPT_INIT;   // Initialize Pak
    esc.lpvInBuffer = NULL;
    esc.cbInBuffer = 0;
    esc.lpvOutBuffer = status;   
    esc.cbOutBuffer = 1;

	HRESULT hr = lpDirectInputDevice->Escape(&esc);

#ifdef _DEBUG
	_debugAd( "Direct Adaptoid InitPak", hr );
#endif // #ifdef _DEBUG

    return hr;
}
开发者ID:Anonymous2,项目名称:project64,代码行数:19,代码来源:DirectInput.cpp

示例3: DirectRumbleCommand

HRESULT DirectRumbleCommand( LPDIRECTINPUTDEVICE8 lpDirectInputDevice, DWORD cmd )
{
    DIEFFESCAPE esc;

    esc.dwSize = sizeof(esc);
    esc.dwCommand = ADAPT_RUMBLE;   // send rumble command
    esc.lpvInBuffer = &cmd;  // 1=go, 0=stop
    esc.cbInBuffer = 4;
    esc.lpvOutBuffer = NULL;
    esc.cbOutBuffer = 0;

	HRESULT hr = lpDirectInputDevice->Escape(&esc);

#ifdef _DEBUG
	_debugAd( "Direct Adaptoid RumbleCommand", hr );
#endif // #ifdef _DEBUG

    return hr;
}
开发者ID:Anonymous2,项目名称:project64,代码行数:19,代码来源:DirectInput.cpp

示例4: IsAdaptoidCommandSupported

bool IsAdaptoidCommandSupported( LPDIRECTINPUTDEVICE8 lpDirectInputDevice, DWORD cmd )
{
    DIEFFESCAPE esc;
    DWORD inbuf, outbuf;
    HRESULT hr;

	esc.dwSize = sizeof(esc);
	esc.dwCommand = ADAPT_TEST;   // command to determine if a command is supported
	esc.lpvInBuffer = &inbuf;
	esc.cbInBuffer = 4;
	esc.lpvOutBuffer = &outbuf;   
	esc.cbOutBuffer = 4;
	inbuf = cmd;                  // command that we are asking is supported
	outbuf = 0;                   

	hr = lpDirectInputDevice->Escape(&esc);

    return( SUCCEEDED(hr) && esc.cbOutBuffer == 4 && outbuf == 0xB0CAB0CA );
}
开发者ID:Anonymous2,项目名称:project64,代码行数:19,代码来源:DirectInput.cpp

示例5: ReadAdaptoidPak

HRESULT ReadAdaptoidPak( LPDIRECTINPUTDEVICE8 lpDirectInputDevice, DWORD addr, LPBYTE data )
{
    DIEFFESCAPE esc;

    esc.dwSize = sizeof(esc);
    esc.dwCommand = ADAPT_READPAK;   // Read 32 bytes from pak
    esc.lpvInBuffer = &addr;
    esc.cbInBuffer = 4;
    esc.lpvOutBuffer = data;   
    esc.cbOutBuffer = 32;

	HRESULT hr = lpDirectInputDevice->Escape(&esc);

#ifdef _DEBUG
	LPCSTR suc = (SUCCEEDED(hr)) ? "OK" : "FAILED";

	DebugWriteA( "Direct Adaptoid ReadPak(Addr:%04X): %s (RC:%08X)\n", addr, suc, hr );
#endif // #ifdef _DEBUG

    return hr;
}
开发者ID:Anonymous2,项目名称:project64,代码行数:21,代码来源:DirectInput.cpp

示例6: Escape

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


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