Jump to content
  • Advertisement
Sign in to follow this  
jhuelin

Direct Input : Action Map Pb

This topic is 4720 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, I've made an application with direct input actionmaps. All is working fine. But now i want to be able to change the mapping with my own interface and not the with direct input interface (with the configuredevice function). i want to change the action 'fire' from key 'O' to key 'P' I've tried many things like that : unacquire all devices buildactionmap change the DIACTIONFORMAT structure and setactionmap and after that O and P doesn't response (but the others yes!)! how can i do that ???

Share this post


Link to post
Share on other sites
Advertisement
The method you described (unacquire, build, change, set) is correct. So, there must be something wrong with the values you are setting. Perhaps, if you posted the code, we could help you to identify the problem.

Share this post


Link to post
Share on other sites
ok

this is a piece a code:

UnacquireDevices();

HRESULT hr;

hr = pdidDevice->BuildActionMap( &diaf, mStrUserName, 0 );

if( FAILED(hr) )return hr;

for (int i = 0 ; i < NB_ACTIONMAPS ; ++i)
{
if (diaf.rgoAction.uAppData == INPUT_FIRE ) // for the fire action
{
diaf.rgoAction.dwSemantic = DIKEYBOARD_P; // key P
break;
}
}

hr = pdidDevice->SetActionMap( &diaf, mStrUserName, DIDSAM_FORCESAVE );
if( FAILED(hr) ) return hr;

what's wrong ?

Share this post


Link to post
Share on other sites
I just have one mapping table and the 'P' key is not assigned !

I have a question. Why when i use the configuredevice function and assign the 'p' key to the 'fire' action it works, but the the diaction structure doesn't contains the new mapping with the 'p' key , it already contains the mapping with the old key ?

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!