typedef struct joyinfoex_tag {
DWORD dwSize;
DWORD dwFlags;
DWORD dwXpos;
DWORD dwYpos;
DWORD dwZpos;
DWORD dwRpos;
DWORD dwUpos;
DWORD dwVpos;
DWORD dwButtons;
DWORD dwButtonNumber;
DWORD dwPOV;
DWORD dwReserved1;
DWORD dwReserved2;
} JOYINFOEX;
Contains extended information about the joystick position, the point-of-view position, and the button state.
Size of this structure, in bytes.
Flags that indicate if information returned in this structure is valid. Members that do not contain valid information are set to 0. The following flags are defined:
Equivalent to setting all the JOY_RETURN values except JOY_RETURNRAWDATA.
The dwButtons member contains valid information about the state of each joystick button.
Centers the joystick neutral position to the middle value of each axis of movement.
The dwPOV member contains valid information about the point-of-view control, which is expressed in discrete units.
The dwPOV member contains valid information about the point-of-view control expressed in continuous, one-hundredth of a degree units.
The dwRpos member contains valid rudder pedal information. This indicates the existence of a fourth axis.
Indicates that uncalibrated joystick readings are stored in this structure.
The dwUpos member contains valid data for a fifth axis of the joystick, if such an axis is available. 0 is returned otherwise.
The dwVpos member contains valid data for a sixth axis of the joystick, if such an axis is available. 0 is returned otherwise.
The dwXpos member contains valid data for the x-coordinate of the joystick.
The dwYpos member contains valid data for the y-coordinate of the joystick.
The dwZpos member contains valid data for the z-coordinate of the joystick.
Expands the range for the neutral position of the joystick and calls this range the dead zone. The joystick driver returns a constant value for all positions in the dead zone.
The following flags provide data to calibrate a joystick and are intended for custom calibration applications:
Reads the x-, y-, and z-coordinates, and then stores the raw values in the dwXpos, dwYpos, and dwZpos members, respectively.
Reads the rudder information and the x-, y-, and z-coordinates, and then stores the raw values in the dwRpos, dwXpos, dwYpos, and dwZpos members, respectively.
Reads the rudder information and the x-, y-, z-, and u-coordinates, and then stores the raw values in the dwRpos, dwXpos, dwYpos, dwZpos, and dwUpos members, respectively.
Reads the raw v-axis data if a joystick minidriver is present to provide the information. Returns 0 otherwise.
Reads the joystick port even if the driver does not detect a device.
Reads the rudder information if a joystick minidriver is present to provide the data, and then stores the raw value in the dwRpos member. Returns 0 otherwise.
Reads the u-coordinate if a joystick minidriver is present to provide the data, and then stores the raw value in the dwUpos member. Returns 0 otherwise.
Reads the v-coordinate if a joystick minidriver is present to provide the data, and then stores the raw value in the dwVpos member. Returns 0 otherwise.
Reads the x-coordinate and stores the raw value in the dwXpos member.
Reads the x- and y-coordinates and stores the raw values in the dwXpos and dwYpos members, respectively.
Reads the y-coordinate and stores the raw value in the dwYpos member.
Reads the z-coordinate and stores the raw value in the dwZpos member.
Current x-coordinate, y-coordinate, and z-coordinate positions, respectively.
Current position of the rudder or fourth joystick axis.
Current fifth axis and sixth axis positions, respectively.
Current state of the 32 joystick buttons. The value of this member can be set to any combination of JOY_BUTTONn flags, where n is a value ranging from 1 to 32. Each value corresponds to the button that is pressed.
Current button number that is pressed.
Current position of the point-of-view control. Values for this member range from 0 to 35,900. These values represent each view's angle, in degrees, multiplied by 100.
Reserved, do not use.
The value of the dwSize member is also used to identify the version number for the structure when it is passed to the joyGetPosEx function.
Most devices with a point-of-view control have only five positions. When the JOY_RETURNPOV flag is set, these positions are reported by using the following JOY_POV constants.
Point-of-view positions Description
JOY_POVBACKWARD Point-of-view hat is pressed backward. The value 18,000 represents an orientation of 180.00 degrees.
JOY_POVCENTERED Point-of-view hat is in the neutral position. The value -1 means the point-of-view hat has no angle to report.
JOY_POVFORWARD Point-of-view hat is pressed forward. The value 0 represents an orientation of 0.00 degrees.
JOY_POVLEFT Point-of-view hat is being pressed to the left. The value 27,000 represents an orientation of 270.00 degrees.
JOY_POVRIGHT Point-of-view hat is pressed to the right. The value 9,000 represents an orientation of 90.00 degrees.
The default Windows 95 joystick driver currently supports these five discrete directions. If your application can accept only the defined point-of-view values, it must use the JOY_RETURNPOV flag. If your application can accept other degree readings, it should use the JOY_RETURNPOVCTS flag to obtain continuous data if it is available. The JOY_RETURNPOVCTS flag also supports the JOY_POV constants used with the JOY_RETURNPOV flag.