Jump to content
  • Advertisement
Sign in to follow this  
GK_Vector

DirectInput Mapping Application

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

Hello... I'm new to this forum and let me start out by saying: "I'm not a C programmer!!!" ...I wish I were but I'm much more of a scripter than a programmer. I am hoping, however, for some help on an idea I have relating to game controllers. I'm wondering whether it would be possible to create a mapping application for DirectInput devices. Basicly, the application would enumerate all DI devices connected to the system and allow the user to map the controls on these devices to a single virtual controller. So, for example, if I had two joysticks attached to the system, I could map the axes on one of them to throttle and rudder and have a poor man's HOTAS. The buttons on the T/R stick could be reassigned as well so that they wouldn't conflict with the X/Y stick. The general idea is to give a user control over their game control setup in a layer outside of the games themselves so that limitations within the games could be overcome... Is this possible...practical..? [Edited by - GK_Vector on September 20, 2004 2:09:39 AM]

Share this post


Link to post
Share on other sites
Advertisement
The DirectX SDK shows a sample of an Action Mapper that does this.

I did this for myself too. I boiled down the possible incoming commands to digital (pushed/not pushed) basically. I didn't use the analog capabilities of joysticks for example; they're transformed to digital (full left, full right, ...). This allows me to use the mouse to play a jump'n'run for example (not really useful, but fun nonetheless).

The key is using EnumDevices with EnumObjects inside. This will list all keyboard keys, joystick axes, buttons, coolie hats, whatever. Now you "just" need to put that information in some structure. After polling all devices you translate the information to simple pressed/released flags.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!