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


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

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


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

示例1: INPKBGetKeyName

void F_API INPKBGetKeyName(u8 kCode, tCHAR *outbuffer, u32 size)
{
	DIPROPSTRING string={0};

	string.diph.dwSize = sizeof(DIPROPSTRING);
	string.diph.dwHeaderSize = sizeof(DIPROPHEADER);
	string.diph.dwObj = kCode;
	string.diph.dwHow = DIPH_BYOFFSET;

	HRESULT hr = g_pDKeyboard->GetProperty(DIPROP_KEYNAME,
	&string.diph);

	if(FAILED(hr))
	{ *outbuffer=0; }
	else
	{
		if(size > 260)
		{
			memcpy(outbuffer, string.wsz, sizeof(string.wsz));
		}
		else
		{
			memcpy(outbuffer, string.wsz, sizeof(tCHAR)*size);
			outbuffer[size-1] = 0;
		}
		//wcscpy(outbuffer, string.wsz);
	}

	/*WideCharToMultiByte(CP_ACP, 0, string.wsz, -1,
	outbuffer, outbuffersize, 
	NULL, NULL);*/
}
开发者ID:ddionisio,项目名称:Mahatta,代码行数:32,代码来源:inputdx8_keyboard.cpp

示例2: GetDeviceName

std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device)
{
  DIPROPSTRING str = {};
  str.diph.dwSize = sizeof(str);
  str.diph.dwHeaderSize = sizeof(str.diph);
  str.diph.dwHow = DIPH_DEVICE;

  std::string result;
  if (SUCCEEDED(device->GetProperty(DIPROP_PRODUCTNAME, &str.diph)))
  {
    result = StripSpaces(UTF16ToUTF8(str.wsz));
  }

  return result;
}
开发者ID:Anti-Ultimate,项目名称:dolphin,代码行数:15,代码来源:DInput.cpp

示例3: GetDeviceName

std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device)
{
	std::string out;

	DIPROPSTRING str;
	ZeroMemory(&str, sizeof(str));
	str.diph.dwSize = sizeof(str);
	str.diph.dwHeaderSize = sizeof(str.diph);
	str.diph.dwHow = DIPH_DEVICE;

	if (SUCCEEDED(device->GetProperty(DIPROP_PRODUCTNAME, &str.diph)))
	{
		const int size = WideCharToMultiByte(CP_UTF8, 0, str.wsz, -1, NULL, 0, NULL, NULL);
		char* const data = new char[size];
		if (size == WideCharToMultiByte(CP_UTF8, 0, str.wsz, -1, data, size, NULL, NULL))
			out.assign(data);
		delete[] data;
	}

	return StripSpaces(out);
}
开发者ID:Zombiebest,项目名称:Dolphin,代码行数:21,代码来源:DInput.cpp

示例4: if

//=======================================================================
// get range for an axis
static HRESULT	GetDIAxisRange(LPDIRECTINPUTDEVICE8 device, uint offset, DWORD type, sint &min, sint &max)
{
	DIPROPRANGE diprg;
    diprg.diph.dwSize       = sizeof(DIPROPRANGE);
    diprg.diph.dwHeaderSize = sizeof(DIPROPHEADER);
    diprg.diph.dwHow        = DIPH_BYOFFSET;
    diprg.diph.dwObj        = offset;

	// Set the range for the axis
	HRESULT r = device->GetProperty(DIPROP_RANGE, &diprg.diph);

	if (r == DIERR_OBJECTNOTFOUND)
	{
		// try from its ID
		diprg.diph.dwHow        = DIPH_BYID;
		diprg.diph.dwObj        = type;

		// Set the range for the axis
		HRESULT r = device->GetProperty(DIPROP_RANGE, &diprg.diph);
		if (r !=  DI_OK)
		{
			// setup default values ...
			min = 0;
			max = 65535;
			return r;
		}
	}
	else if (r != DI_OK)
	{
		min = 0;
		max = 65535;
		return r;
	}


/*	switch (r)
	{
		default:
			nlinfo("ok");
		break;
		case DIERR_INVALIDPARAM:
			nlinfo("invalid param");
		break;
		case DIERR_NOTEXCLUSIVEACQUIRED:
			nlinfo("DIERR_NOTEXCLUSIVEACQUIRED");
		break;
		case DIERR_NOTINITIALIZED:
			nlinfo("DIERR_NOTINITIALIZED");
		break;
		case DIERR_OBJECTNOTFOUND:
			nlinfo("DIERR_OBJECTNOTFOUND");
		break;
		case DIERR_UNSUPPORTED:
			nlinfo("DIERR_UNSUPPORTED");
		break;
	}*/


	min = (sint) diprg.lMin;
	max = (sint) diprg.lMax;

	return r;
}
开发者ID:mixxit,项目名称:solinia,代码行数:65,代码来源:di_game_device.cpp

示例5: GetProperty

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


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