# DirectInput controller axis

## Recommended Posts

camomilk    122
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 on other sites
camomilk    122
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.