typedef struct joycalibrate_tag {
WORD wXbase;
WORD wXdelta;
WORD wYbase;
WORD wYdelta;
WORD wZbase;
WORD wZdelta;
} JOYCALIBRATE;
The JOYCALIBRATE structure contains calibration values for the three axes of an absolute position device.
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 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:
Delta = (LogicalMax - LogicalMin) / (DeviceMax - DeviceMin)
The LogicalMax and LogicalMin members represent the maximum and minimum logical coordinate values for the axis, as defined by the JOYCAPS structure, which is described in the Win32 SDK. DeviceMax and DeviceMin represent the actual values returned by the device.
The following formula is used to calculate the base values:
Base = (DeviceMin * Delta) - LogicalMin
The DeviceMin member 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 JOYCAPS).