Skip to main content
GameDev.net gamedev.net
🔒 Locked

DirectInput controller axis

Started by camomilk Nov 8, 2004 at 1:42 AM 0 replies 850+ views
Original Post
camomilk
camomilk
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?
There are 10 types of people in the world: Those who know binary and those who don''t.
camomilk
camomilk
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.
There are 10 types of people in the world: Those who know binary and those who don''t.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.