ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference
|
IOHIDElement.h |
Includes: |
IOHIDElement defines a parsed item contained within a Human Interface Device (HID) object. It is used to obtain properties of the parsed. It can also be used to set properties such as calibration settings. IOHIDElement is a CFType object and as such conforms to all the conventions expected such object.
This documentation assumes that you have a basic understanding of the material contained in Accessing Hardware From Applications For definitions of I/O Kit terms used in this documentation, such as matching dictionary, family, and driver, see the overview of I/O Kit terms and concepts in the "Device Access and the I/O Kit" chapter of Accessing Hardware From Applications. This documentation also assumes you have read Human Interface Device & Force Feedback. Please review documentation before using this reference.
All of the information described in this document is contained in the header file IOHIDElement.h found at /System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDElement.h.
Establish a relationship between one or more elements.
Retrieves the collection type for the element.
Obtain attached elements.
Creates an element from a dictionary.
Remove a relationship between one or more elements.
Returns the children for the element.
Retrieves the collection type for the element.
Retrieves the cookie for the element.
Obtain the device associated with the element.
Returns the maximum value possible for the element.
Returns the minimum value possible for the element.
Returns the maximum value possible for the element.
Returns the name for the element.
Returns the parent for the element.
Returns the scaled maximum value possible for the element.
Returns the scaled minimum value possible for the element.
Returns the an element property.
Returns the report count for the element.
Returns the report ID for the element.
Returns the report size in bits for the element.
Retrieves the type for the element.
Returns the type identifier of all IOHIDElement instances.
Returns the unit property for the element.
Returns the unit exponenet in base 10 for the element.
Retrieves the usage for an element.
Retrieves the usage page for an element.
Returns the null state property for the element.
Returns the preferred state property for the element.
Returns the array property for the element.
Returns the linear property for the element.
Returns the relative property for the element.
Returns the virtual property for the element.
Returns the wrap property for the element.
Sets an element property.
IOHIDElementAttach |
Establish a relationship between one or more elements.
CF_EXPORT void IOHIDElementAttach( IOHIDElementRef element, IOHIDElementRef toAttach) ;
element
The element to be modified. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
toAttach
The element to be attached. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
This is useful for grouping HID elements with related functionality.
IOHIDElementCollectionType |
Retrieves the collection type for the element.
CF_EXPORT IOHIDElementCollectionType IOHIDElementGetCollectionType( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the IOHIDElementCollectionType for the element.
The value returned by this method only makes sense if the element type is kIOHIDElementTypeCollection.
IOHIDElementCopyAttached |
Obtain attached elements.
CF_EXPORT CFArrayRef IOHIDElementCopyAttached( IOHIDElementRef element) ;
element
The element to be modified. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns a copy of the current attached elements.
Attached elements are those that have been grouped via IOHIDElementAttach.
IOHIDElementCreateWithDictionary |
Creates an element from a dictionary.
CF_EXPORT IOHIDElementRef IOHIDElementCreateWithDictionary( CFAllocatorRef allocator, CFDictionaryRef dictionary) ;
allocator
Allocator to be used during creation.
dictionary
dictionary containing values in which to create element.
Returns a new IOHIDElementRef.
The dictionary should contain keys defined in IOHIDKeys.h and start with kIOHIDElement. This call is meant be used by a IOHIDDeviceDeviceInterface object.
IOHIDElementDetach |
Remove a relationship between one or more elements.
CF_EXPORT void IOHIDElementDetach( IOHIDElementRef element, IOHIDElementRef toDetach) ;
element
The element to be modified. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
toDetach
The element to be detached. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
This is useful for grouping HID elements with related functionality.
IOHIDElementGetChildren |
Returns the children for the element.
CF_EXPORT CFArrayRef IOHIDElementGetChildren( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns an CFArrayRef containing element objects of type IOHIDElementRef.
An element of type kIOHIDElementTypeCollection usually contains children.
IOHIDElementGetCollectionType |
Retrieves the collection type for the element.
CF_EXPORT IOHIDElementCollectionType IOHIDElementGetCollectionType( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the IOHIDElementCollectionType for the element.
The value returned by this method only makes sense if the element type is kIOHIDElementTypeCollection.
IOHIDElementGetCookie |
Retrieves the cookie for the element.
CF_EXPORT IOHIDElementCookie IOHIDElementGetCookie( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the IOHIDElementCookie for the element.
The IOHIDElementCookie represent a unique identifier for an element within a device.
IOHIDElementGetDevice |
Obtain the device associated with the element.
CF_EXPORT IOHIDDeviceRef IOHIDElementGetDevice( IOHIDElementRef element) ;
element
IOHIDElement to be queried.
Returns the a reference to the device.
IOHIDElementGetLogicalMax |
Returns the maximum value possible for the element.
CF_EXPORT CFIndex IOHIDElementGetLogicalMax( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the logical maximum.
This corresponds to the logical maximum, which indicates the upper bounds of a variable element.
IOHIDElementGetLogicalMin |
Returns the minimum value possible for the element.
CF_EXPORT CFIndex IOHIDElementGetLogicalMin( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the logical minimum.
This corresponds to the logical minimun, which indicates the lower bounds of a variable element.
IOHIDElementGetMax |
Returns the maximum value possible for the element.
CF_EXPORT CFIndex IOHIDElementGetLogicalMax( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the logical maximum.
This corresponds to the logical maximum, which indicates the upper bounds of a variable element.
IOHIDElementGetName |
Returns the name for the element.
CF_EXPORT CFStringRef IOHIDElementGetName( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns CFStringRef containing the element name.
IOHIDElementGetParent |
Returns the parent for the element.
CF_EXPORT IOHIDElementRef IOHIDElementGetParent( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns an IOHIDElementRef referencing the parent element.
The parent element can be an element of type kIOHIDElementTypeCollection.
IOHIDElementGetPhysicalMax |
Returns the scaled maximum value possible for the element.
CF_EXPORT CFIndex IOHIDElementGetPhysicalMax( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the physical maximum.
Maximum value for the physical extent of a variable element. This represents the value for the logical maximum with units applied to it.
IOHIDElementGetPhysicalMin |
Returns the scaled minimum value possible for the element.
CF_EXPORT CFIndex IOHIDElementGetPhysicalMin( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the physical minimum.
Minimum value for the physical extent of a variable element. This represents the value for the logical minimum with units applied to it.
IOHIDElementGetProperty |
Returns the an element property.
CF_EXPORT CFTypeRef IOHIDElementGetProperty( IOHIDElementRef element, CFStringRef key) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
key
The key to be used when querying the element.
Returns the property.
Property keys are prefixed by kIOHIDElement and declared in IOHIDKeys.h.
IOHIDElementGetReportCount |
Returns the report count for the element.
CF_EXPORT uint32_t IOHIDElementGetReportCount( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the report count.
IOHIDElementGetReportID |
Returns the report ID for the element.
CF_EXPORT uint32_t IOHIDElementGetReportID( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the report ID.
The report ID represents what report this particular element belongs to.
IOHIDElementGetReportSize |
Returns the report size in bits for the element.
CF_EXPORT uint32_t IOHIDElementGetReportSize( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the report size.
IOHIDElementGetType |
Retrieves the type for the element.
CF_EXPORT IOHIDElementType IOHIDElementGetType( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the IOHIDElementType for the element.
IOHIDElementGetTypeID |
Returns the type identifier of all IOHIDElement instances.
CF_EXPORT CFTypeID IOHIDElementGetTypeID( void) ;
IOHIDElementGetUnit |
Returns the unit property for the element.
CF_EXPORT uint32_t IOHIDElementGetUnit( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the unit.
The unit property is described in more detail in Section 6.2.2.7 of the "Device Class Definition for Human Interface Devices(HID)" Specification, Version 1.11.
IOHIDElementGetUnitExponent |
Returns the unit exponenet in base 10 for the element.
CF_EXPORT uint32_t IOHIDElementGetUnitExponent( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the unit exponent.
The unit exponent property is described in more detail in Section 6.2.2.7 of the "Device Class Definition for Human Interface Devices(HID)" Specification, Version 1.11.
IOHIDElementGetUsage |
Retrieves the usage for an element.
CF_EXPORT uint32_t IOHIDElementGetUsage( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the usage for the element.
IOHIDElementGetUsagePage |
Retrieves the usage page for an element.
CF_EXPORT uint32_t IOHIDElementGetUsagePage( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the usage page for the element.
IOHIDElementHasNullState |
Returns the null state property for the element.
CF_EXPORT Boolean IOHIDElementHasNullState( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns TRUE if null state or FALSE if no null state.
Indicates whether the element has a state in which it is not sending meaningful data.
IOHIDElementHasPreferredState |
Returns the preferred state property for the element.
CF_EXPORT Boolean IOHIDElementHasPreferredState( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns TRUE if preferred state or FALSE if no preferred state.
Indicates whether the element has a preferred state to which it will return when the user is not physically interacting with the control.
IOHIDElementIsArray |
Returns the array property for the element.
CF_EXPORT Boolean IOHIDElementIsArray( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns TRUE if array or FALSE if variable.
Indicates whether the element represents variable or array data values. Variable values represent data from a
physical control. An array returns an index in each field that corresponds to the pressed button
(like keyboard scan codes).
Note: The HID Manager will represent most elements as "variable" including the possible usages of an array.
Array indices will remain as "array" elements with a usage of 0xffffffff.
IOHIDElementIsNonLinear |
Returns the linear property for the element.
CF_EXPORT Boolean IOHIDElementIsNonLinear( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns TRUE if non linear or FALSE if linear.
Indicates whether the value for the element has been processed in some way, and no longer represents a linear relationship between what is measured and the value that is reported.
IOHIDElementIsRelative |
Returns the relative property for the element.
CF_EXPORT Boolean IOHIDElementIsRelative( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns TRUE if relative or FALSE if absolute.
Indicates whether the data is relative (indicating the change in value from the last report) or absolute (based on a fixed origin).
IOHIDElementIsVirtual |
Returns the virtual property for the element.
CF_EXPORT Boolean IOHIDElementIsVirtual( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns the TRUE if virtual or FALSE if not.
Indicates whether the element is a virtual element.
IOHIDElementIsWrapping |
Returns the wrap property for the element.
CF_EXPORT Boolean IOHIDElementIsWrapping( IOHIDElementRef element) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
Returns TRUE if wrapping or FALSE if non-wrapping.
Wrap indicates whether the data "rolls over" when reaching either the extreme high or low value.
IOHIDElementSetProperty |
Sets an element property.
CF_EXPORT Boolean IOHIDElementSetProperty( IOHIDElementRef element, CFStringRef key, CFTypeRef property) ;
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
key
The key to be used when querying the element.
Returns TRUE if successful.
This method can be used to set arbitrary element properties, such as application specific references.
|
Last Updated: 2009-02-23