介绍游戏杆的编程
DWORD dwZpos; /* z position */
DWORD dwRpos; /* rudder/4th axis position */
DWORD dwUpos; /* 5th axis position */
DWORD dwVpos; /* 6th axis position */
DWORD dwButtons; /* button states */
DWORD dwButtonNumber; /* current button number pressed */
DWORD dwPOV; /* point of view state */
DWORD dwReserved1;
DWORD dwReserved2;
} JOYINFOEX, *PJOYINFOEX, NEAR *NPJOYINFOEX, FAR *LPJOYINFOEX;
使用此函数前要先通过设置pji->dwFlags的值来指定要返回的值,否则很可能会得不到想要的信息,我因为没注意这点而郁闷了很久。dwFlags的值可用下列预定义常数来设置:
#define JOY_RETURNX 0x00000001l
#define JOY_RETURNY 0x00000002l
#define JOY_RETURNZ 0x00000004l
#define JOY_RETURNR 0x00000008l
#define JOY_RETURNU 0x00000010l /* axis 5 */
#define JOY_RETURNV 0x00000020l /* axis 6 */
#define JOY_RETURNPOV 0x00000040l
#define JOY_RETURNBUTTONS 0x00000080l
#define JOY_RETURNRAWDATA 0x00000100l
#define JOY_RETURNPOVCTS 0x00000200l
#define JOY_RETURNCENTERED 0x00000400l