JOYCALIBRATE

The JOYCALIBRATE structure contains calibration values for the three axes of an absolute position device.

typedef struct joycalibrate_tag {

UINT wXbase;

UINT wXdelta;

UINT wYbase;

UINT wYdelta;

UINT wZbase;

UINT wZdelta;

} JOYCALIBRATE;

Fields

The JOYCALIBRATE structure has the following fields:

wXbase

Specifies a base calibration value for the x axis.

wXdelta

Specifies a delta calibration value for the x axis.

wYbase

Specifies a base calibration value for the y axis.

wYdelta

Specifies a delta calibration value for the y axis.

wZbase

Specifies a base calibration value for the z axis.

wZdelta

Specifies a delta calibration value for the z axis.

Comments

Use the base and delta values returned in this structure to convert actual device values to the logical value range specified by the driver.

The base values represent the lowest logical value that the driver returns for a given axis. The delta values are multipliers that the driver should use when mapping the value returned by the device into the value range established by the driver.

The following formula is used to calculate the delta values:

<$Eroman Delta~=~{roman (LogicalMax~-~roman LogicalMin)}over {roman (DeviceMax~-~roman DeviceMin)}>

where LogicalMax and LogicalMin represent the maximum and minimum logical coordinate values for the axis, as defined by the JOYCAPS structure. DeviceMax and DeviceMin represent the actual values returned by the device.

The following formula is used to calculate the base values:

roman Base~=~roman (DeviceMin~times~roman Delta)~-~roman LogicalMin

where DeviceMin represents the minimum value returned by the device, Delta represents the delta value calculated using the first formula, and LogicalMin represents the minimum value returned by the driver (as defined by the JOYCAPS structure).