本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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 );
}
示例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;
}
示例6: Escape
HRESULT _stdcall Escape(LPDIEFFESCAPE a) {
return RealDevice->Escape(a);
}