Skip to content

Latest commit

 

History

History
233 lines (171 loc) · 6.07 KB

nf-hidpi-hidp_setscaledusagevalue.md

File metadata and controls

233 lines (171 loc) · 6.07 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:hidpi.HidP_SetScaledUsageValue
HidP_SetScaledUsageValue function (hidpi.h)
The HidP_SetScaledUsageValue routine converts a signed and scaled physical number to a HID usage's logical value, and sets the usage value in a specified HID report.
hid\hidp_setscaledusagevalue.htm
hid
04/30/2018
HidP_SetScaledUsageValue function
HidP_SetScaledUsageValue, HidP_SetScaledUsageValue routine [Human Input Devices], hid.hidp_setscaledusagevalue, hidfunc_0fcd2d78-aae7-4d56-a930-9bf0e4a417bf.xml, hidpi/HidP_SetScaledUsageValue
hidpi.h
Hidpi.h
Universal
Available in Windows 2000 and later versions of Windows.
Hidparse.lib
<= DISPATCH_LEVEL
Windows
HidP_SetScaledUsageValue
hidpi/HidP_SetScaledUsageValue
APIRef
kbSyntax
LibDef
Hidparse.lib
Hidparse.dll
HidP_SetScaledUsageValue

HidP_SetScaledUsageValue function

-description

The HidP_SetScaledUsageValue routine converts a signed and scaled physical number to a HID usage's logical value, and sets the usage value in a specified HID report.

-parameters

-param ReportType [in]

Specifies a HIDP_REPORT_TYPE enumerator value that indicates the type of HID report located at Report.

-param UsagePage [in]

Specifies the usage page of a usage.

-param LinkCollection [in]

Specifies the link collection that contains the usage. If LinkCollection is nonzero, the routine only sets the usage, if one exists, in this link collection. If LinkCollection is zero, the routine sets the first usage it finds in the top-level collection associated with PreparsedData.

-param Usage [in]

Specifies the usage.

-param UsageValue [in]

Specifies the signed and scaled physical number, which the routine converts to the usage's logical value.

-param PreparsedData [in]

Pointer to a top-level's preparsed data.

-param Report [in, out]

Pointer to a HID report.

-param ReportLength [in]

Specifies the size, in bytes, of the HID report located at Report, which must be equal to the report length for the specified report type that HidP_GetCaps returns in a collection's HIDP_CAPS structure.

-returns

HidP_SetScaledUsageValue returns one of the following status values:

Return code Description
HIDP_STATUS_SUCCESS
The routine successfully set the usage value.
HIDP_STATUS_BAD_LOG_PHY_VALUES
The usage has an illegal logical or physical range that prevents scaling.
HIDP_STATUS_VALUE_OUT_OF_RANGE
The specified physical value is out-of-range and the usage does not have null value.
HIDP_STATUS_INVALID_REPORT_LENGTH
The report length is not valid.
HIDP_STATUS_INVALID_REPORT_TYPE
The specified report type is not valid.
HIDP_STATUS_INCOMPATIBLE_REPORT_ID
The usage does not exist in the specified report, but it does exist in a different report of the specified type.
HIDP_STATUS_INVALID_PREPARSED_DATA
The preparsed data is not valid.
HIDP_STATUS_USAGE_NOT_FOUND
The usage does not exist in any report of the specified report type.
HIDP_STATUS_NULL
The specified physical value is out-of-range, the usage has a null value, and the routine set the null value.

-remarks

HidP_SetScaledUsageValue sets the sign bit.

If the routine returns HIDP_STATUS_INCOMPATIBLE_REPORT_ID, the specified report does contain the usage. However, a user-mode application or kernel-mode driver can set the usage in a zero-initialized report. See Initializing HID Reports.

For more information, see HID Collections.

-see-also

HIDP_CAPS

HIDP_REPORT_TYPE

HidP_GetCaps

HidP_SetUsageValue

HidP_SetUsageValueArray

_HIDP_PREPARSED_DATA