DirectInput Mapping Application

Started by
0 comments, last by Endurion 19 years, 7 months ago
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]
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.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

This topic is closed to new replies.

Advertisement