JOYINFOEX

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.

dwSize

Size of this structure, in bytes.

dwFlags

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:

JOY_RETURNALL

Equivalent to setting all of the JOY_RETURN values except JOY_RETURNRAWDATA.

JOY_RETURNBUTTONS

The dwButtons member contains valid information about the state of each joystick button.

JOY_RETURNCENTERED

Centers the joystick neutral position to the middle value of each axis of movement.

JOY_RETURNPOV

The dwPOV member contains valid information about the point-of-view control, which is expressed in discrete units.

JOY_RETURNPOVCTS

The dwPOV member contains valid information about the point-of-view control expressed in continuous, one-hundredth of a degree units.

JOY_RETURNR

The dwRpos member contains valid rudder pedal information. This indicates the existence of a fourth axis.

JOY_RETURNRAWDATA

Indicates that uncalibrated joystick readings are stored in this structure.

JOY_RETURNU

The dwUpos member contains valid data for a fifth axis of the joystick, if such an axis is available. 0 is returned otherwise.

JOY_RETURNV

The dwVpos member contains valid data for a sixth axis of the joystick, if such an axis is available. 0 is returned otherwise.

JOY_RETURNX

The dwXpos member contains valid data for the x-coordinate of the joystick.

JOY_RETURNY

The dwYpos member contains valid data for the y-coordinate of the joystick.

JOY_RETURNZ

The dwZpos member contains valid data for the z-coordinate of the joystick.

JOY_USEDEADZONE

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:

JOY_CAL_READ3

Reads the x-, y-, and z-coordinates, then stores the raw values in the dwXpos, dwYpos, and dwZpos members, respectively.

JOY_CAL_READ4

Reads the rudder information and the x-, y-, and z-coordinates, then stores the raw values in the dwRpos, dwXpos, dwYpos, and dwZpos members, respectively.

JOY_CAL_READ5

Reads the rudder information and the x-, y-, z-, and u-coordinates, then stores the raw values in the dwRpos, dwXpos, dwYpos, dwZpos, and dwUpos members, respectively.

JOY_CAL_READ6

Reads the raw v-axis data if a joystick minidriver is present to provide the information. Returns 0 otherwise.

JOY_CAL_READALWAYS

Reads the joystick port even if the driver does not detect a device.

JOY_CAL_READRONLY

Reads the rudder information if a joystick minidriver is present to provide the data, then stores the raw value in the dwRpos member. Returns 0 otherwise.

JOY_CAL_READUONLY

Reads the u-coordinate if a joystick minidriver is present to provide the data, then stores the raw value in the dwUpos member. Returns 0 otherwise.

JOY_CAL_READVONLY

Reads the v-coordinate if a joystick minidriver is present to provide the data, then stores the raw value in the dwVpos member. Returns 0 otherwise.

JOY_CAL_READXONLY

Reads the x-coordinate and stores the raw value in the dwXpos member.

JOY_CAL_READXYONLY

Reads the x- and y-coordinates and stores the raw values in the dwXpos and dwYpos members, respectively.

JOY_CAL_READYONLY

Reads the y-coordinate and stores the raw value in the dwYpos member.

JOY_CAL_READZONLY

Reads the z-coordinate and stores the raw value in the dwZpos member.

dwXpos, dwYpos, dwZpos

Current x-coordinate, y-coordinate, and z-coordinate positions, respectively.

dwRpos

Current position of the rudder or fourth joystick axis.

dwUpos, dwVpos

Current 5th axis and 6th axis positions, respectively.

dwButtons

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 one to 32. Each value corresponds to the button that is pressed.

dwButtonNumber

Current button number that is pressed.

dwPOV

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.

dwReserved1, dwReserved2

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.