Sign in to follow this  
camomilk

DirectInput controller axis

Recommended Posts

I'm using action mapping with directInput8 and have set it up to detect input from a keyboard and a controller, however I'm not sure what values to check the left/right axis against to tell which direction it is being pressed. Any help?

Share this post


Link to post
Share on other sites
bump!

Here's where I check the axis:


case INPUT_ROTATE_AXIS_LR:
{
if(rgdod[j].dwData < 0)
{
BIT_SET(m_uiKeys, KEYBIT_LEFT);
break;
}
else if(rgdod[j].dwData > 0)
{
BIT_SET(m_uiKeys, KEYBIT_LEFT);
break;
}
}


and here's where I initialize the axis min/max values:


m_diaf.lAxisMin = -99;
m_diaf.lAxisMax = 99;


where m_diaf is a DIACTIONFORMAT structure. I know for certain beyond a shadow of a doubt that the code where I check the values is wrong (dwdata is an unsigned type), but I don't know what values I actually should be checking against.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this