Sign in to follow this  
GK_Vector

DirectInput Mapping Application

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
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

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