Direct Input : Action Map Pb

Started by
3 comments, last by jhuelin 18 years, 10 months ago
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 ???
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.
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 ?
I don't see anything wrong with your code. Is it possible that something is already mapped to the 'P' key?
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 ?

This topic is closed to new replies.

Advertisement