Export (0) Print
Expand All
Expand Minimize

JOYINFOEX structure

The JOYINFOEX structure contains extended information about the joystick position, point-of-view position, and button state.

Syntax


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;

Members

dwSize

Size, in bytes, of this structure.

dwFlags

Flags indicating the valid information returned in this structure. Members that do not contain valid information are set to zero. The following flags are defined:

FlagDescription
JOY_RETURNALLEquivalent to setting all of the JOY_RETURN bits except JOY_RETURNRAWDATA.
JOY_RETURNBUTTONSThe dwButtons member contains valid information about the state of each joystick button.
JOY_RETURNCENTEREDCenters the joystick neutral position to the middle value of each axis of movement.
JOY_RETURNPOVThe dwPOV member contains valid information about the point-of-view control, expressed in discrete units.
JOY_RETURNPOVCTSThe dwPOV member contains valid information about the point-of-view control expressed in continuous, one-hundredth degree units.
JOY_RETURNRThe dwRpos member contains valid rudder pedal data. This information represents another (fourth) axis.
JOY_RETURNRAWDATAData stored in this structure is uncalibrated joystick readings.
JOY_RETURNUThe dwUpos member contains valid data for a fifth axis of the joystick, if such an axis is available, or returns zero otherwise.
JOY_RETURNVThe dwVpos member contains valid data for a sixth axis of the joystick, if such an axis is available, or returns zero otherwise.
JOY_RETURNXThe dwXpos member contains valid data for the x-coordinate of the joystick.
JOY_RETURNYThe dwYpos member contains valid data for the y-coordinate of the joystick.
JOY_RETURNZThe dwZpos member contains valid data for the z-coordinate of the joystick.

 

The following flags provide data to calibrate a joystick and are intended for custom calibration applications.

FlagDescription
JOY_CAL_READ3Read the x-, y-, and z-coordinates and store the raw values in dwXpos, dwYpos, and dwZpos.
JOY_CAL_READ4Read the rudder information and the x-, y-, and z-coordinates and store the raw values in dwXpos, dwYpos, dwZpos, and dwRpos.
JOY_CAL_READ5Read the rudder information and the x-, y-, z-, and u-coordinates and store the raw values in dwXpos, dwYpos, dwZpos, dwRpos, and dwUpos.
JOY_CAL_READ6Read the raw v-axis data if a joystick mini driver is present that will provide the data. Returns zero otherwise.
JOY_CAL_READALWAYSRead the joystick port even if the driver does not detect a device.
JOY_CAL_READRONLYRead the rudder information if a joystick mini-driver is present that will provide the data and store the raw value in dwRpos. Return zero otherwise.
JOY_CAL_READXONLYRead the x-coordinate and store the raw (uncalibrated) value in dwXpos.
JOY_CAL_READXYONLYReads the x- and y-coordinates and place the raw values in dwXpos and dwYpos.
JOY_CAL_READYONLYReads the y-coordinate and store the raw value in dwYpos.
JOY_CAL_READZONLYRead the z-coordinate and store the raw value in dwZpos.
JOY_CAL_READUONLYRead the u-coordinate if a joystick mini-driver is present that will provide the data and store the raw value in dwUpos. Return zero otherwise.
JOY_CAL_READVONLYRead the v-coordinate if a joystick mini-driver is present that will provide the data and store the raw value in dwVpos. Return zero otherwise.

 

dwXpos

Current X-coordinate.

dwYpos

Current Y-coordinate.

dwZpos

Current Z-coordinate.

dwRpos

Current position of the rudder or fourth joystick axis.

dwUpos

Current fifth axis position.

dwVpos

Current sixth axis position.

dwButtons

Current state of the 32 joystick buttons. The value of this member can be set to any combination of JOY_BUTTON n flags, where n is a value in the range of 1 through 32 corresponding 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 are in the range 0 through 35,900. These values represent the angle, in degrees, of each view multiplied by 100.

dwReserved1

Reserved; do not use.

dwReserved2

Reserved; do not use.

Remarks

The value of the dwSize member is also used to identify the version number for the structure when it's 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 constants:

Point-Of-View Flag Description
JOY_POVBACKWARDPoint-of-view hat is pressed backward. The value 18,000 represents an orientation of 180.00 degrees (to the rear).
JOY_POVCENTEREDPoint-of-view hat is in the neutral position. The value -1 means the point-of-view hat has no angle to report.
JOY_POVFORWARDPoint-of-view hat is pressed forward. The value 0 represents an orientation of 0.00 degrees (straight ahead).
JOY_POVLEFTPoint-of-view hat is being pressed to the left. The value 27,000 represents an orientation of 270.00 degrees (90.00 degrees to the left).
JOY_POVRIGHTPoint-of-view hat is pressed to the right. The value 9,000 represents an orientation of 90.00 degrees (to the right).

 

The default joystick driver currently supports these five discrete directions. If an application can accept only the defined point-of-view values, it must use the JOY_RETURNPOV flag. If an 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.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Mmsystem.h (include Windows.h)

See also

Joysticks
Multimedia Joystick Structures
joyGetPosEx
Joysticks
Multimedia Joystick Structures

 

 

Community Additions

ADD
Show:
© 2015 Microsoft