Function

IOHIDValueGetScaledValue

Returns an scaled representaion of the value contained in this IOHIDValueRef based on the scale type.

Declaration

double_t IOHIDValueGetScaledValue(IOHIDValueRef value, IOHIDValueScaleType type);

Parameters

value

The value to be queried. If this parameter is not a valid IOHIDValueRef, the behavior is undefined.

type

The type of scaling to be performed.

Return Value

Returns an scaled floating point representation of the value.

Discussion

The scaled value is based on the range described by the scale type's min and max, such that:

scaledValue = ((value - min) * (scaledMax - scaledMin) / (max - min)) + scaledMin

Note:

There are currently two types of scaling that can be applied:

  • kIOHIDValueScaleTypePhysical: Scales element value using the physical bounds of the device such that scaledMin = physicalMin and scaledMax = physicalMax.

  • kIOHIDValueScaleTypeCalibrated: Scales element value such that scaledMin = -1 and scaledMax = 1. This value will also take into account the calibration properties associated with this element.

See Also

Miscellaneous

IOHIDValueCreateWithBytes

Creates a new element value using byte data.

IOHIDValueCreateWithBytesNoCopy

Creates a new element value using byte data without performing a copy.

IOHIDValueCreateWithIntegerValue

Creates a new element value using an integer value.

IOHIDValueGetBytePtr

Returns a byte pointer to the value contained in this IOHIDValueRef.

IOHIDValueGetElement

Returns the element value associated with this IOHIDValueRef.

IOHIDValueGetIntegerValue

Returns an integer representaion of the value contained in this IOHIDValueRef.

IOHIDValueGetLength

Returns the size, in bytes, of the value contained in this IOHIDValueRef.

IOHIDValueGetTimeStamp

Returns the timestamp value contained in this IOHIDValueRef.

IOHIDValueGetTypeID

Returns the type identifier of all IOHIDValue instances.