Sign in to follow this  

Mapping joypad-analogue sticks into game...

This topic is 4305 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

Hi guys, I've tried a few different joypads in my application...and evey one of them returns a different state in the m_JS variable....for example the right-analogue stick might register in lX, but on another joypad it'll register somewhere different. Anyone know how to correctly map these so that they are consistent? Thanks

Share this post


Link to post
Share on other sites
To correctly map the device to your application you need to provide the user with a way to configure his device. Since, like you just discover, device such as gamepad, as manufacturer dependent.

They build the device the way they want, but they must respect a certain interface that allow you to retreive the status/values of buttons & sticks.

In short, each device is differrent.

Good luck...
Jonathan

Share this post


Link to post
Share on other sites
If you want, you can always try that little dialog thingy that comes along with DInput. Apparently, if you use action-mapping, you can call a skinnable set of forms that will handle all of the end-user configuration for you. However, it wasn't very popular, probably because nobody liked action mapping.

Nevertheless, it is easy to do this yourself. All you need is some type of 'binding' mechanism that allows the user to tie specific input events (ie keyboard presses, joystick movements, ect) to your code. I do it through scripting, but it is easy to do without as well - through a config file you load at init-time perhaps.

Share this post


Link to post
Share on other sites

This topic is 4305 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.

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