Jump to content
  • Advertisement
Sign in to follow this  
hack_tr

Directinput Get Device Name?

This topic is 2107 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello Everyone! rolleyes.gif

HRESULT __stdcall GetDeviceState(LPDIRECTINPUTDEVICE lpDevice, DWORD cbData, LPVOID lpvData) 
{ 
	static BYTE buffer[256]; 
	HRESULT temp = DI_OK; 
	DIDEVICEINSTANCEW didins;   
        didins.dwSize = sizeof( didins );   
        lpDevice->GetDeviceInfo(&didins);
	memcpy(lpvData, buffer, cbData);
	return temp; 
}

lpDevice is Joystick? Or Keyboard? Where can I learn?blink.png

 

Share this post


Link to post
Share on other sites
Advertisement
HRESULT __stdcall hkGetDeviceState(LPDIRECTINPUTDEVICE8 lpDevice, DWORD cbData, LPVOID lpvData) 
{ 
	static BYTE buffer[256]; 
	HRESULT temp = DI_OK; 
	
	DIDEVICEINSTANCEW didins;   
   char procID[255];
sprintf(procID, "%d", cbData);
add_log(procID);

	
        didins.dwSize = sizeof( didins );   
      lpDevice->GetDeviceInfo(&didins);
	  if(didins.dwDevType==DI8DEVTYPE_JOYSTICK )
		  temp = pGetDeviceState(lpDevice, cbData, lpvData);
		
			memcpy(lpvData, buffer, cbData);
		

	return temp; 
}

any key and joystick buttons working.. I want use Only keyboard keys unsure.png

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!