Author: Zhu Jincan
Source: http://www.cnblogs.com/clever101
Recently, I had to develop the game pole programming for the project, so I would like to make a special summary of the gains.
First, test and configure the game rod. In Windows, the control panel has a "game controller" function. You can click it to test and configure the game rod.
At the beginning, I searched online for programming materials for the game pole. The information on the internet is concentrated in multimedia joystick functions in winmm. Lib, similar:Use vc5.0Programming the game Rod. However, I tested it and found that using multimedia joystick functions in winmm. lib has some drawbacks, that isMultimedia joystick FunctionsOnly messages with keys 1, 2, 4, and 4 can be obtained, and messages with eight POV direction keys cannot be obtained. For example, (I am using VC 6.0. It is not ruled out that platformsdk is too old, if an error occurs, use winmm of platformsdk of a later version. correct Lib. Thank you !)
I have to find new ones.POVDirection key method. Continue to search, and finally find a referenceDirectinputMethod acquisitionPOVDirection key message:MFCLowerDirectinputImplementationThe method mentioned in is indeed feasible. In additionMicrosoft DirectX SDK (August 2009)Examples of game controllers are also provided.,Specifically$ \ Microsoft DirectX SDK (August 2009) \ samples \ c ++ \ directinput \ joystick, For other versionsMicrosoft DirectX SDKThere should also be. You can refer to the source code.
There are so many gains, hoping to be helpful to players who want to program the game pole.