---
title: HIDElement.Value
framework: corehid
role: symbol
role_heading: Structure
path: corehid/hidelement/value
---

# HIDElement.Value

Data associated with a HID element.

## Declaration

```swift
struct Value
```

## Mentioned in

Communicating with human interface devices

## Overview

Overview Elements can have data associated with them. This data could be received as an update from the device to indicate user interaction, or could be provided to the device to alter functionality, such as turning on an LED. As the data for an element could be constantly changing, values should be seen as a snapshot of the element’s data at a specific time, and not valid at any other times. Element values can be received by a HIDDeviceClient using HIDDeviceClient.Notification.elementUpdates(values:) after the device issues an input report, or requested from the device by providing a HIDDeviceClient.RequestElementUpdate to updateElements(_:timeout:). Element values can be sent to a device by providing a HIDDeviceClient.ProvideElementUpdate to updateElements(_:timeout:).

## Topics

### Create a HID element from a value

- [init(element:fromBytes:timestamp:)](corehid/hidelement/value/init(element:frombytes:timestamp:).md)
- [init(element:fromPhysicalValue:timestamp:)](corehid/hidelement/value/init(element:fromphysicalvalue:timestamp:).md)
- [init(element:fromLogicalValueTruncatingIfNeeded:timestamp:)](corehid/hidelement/value/init(element:fromlogicalvaluetruncatingifneeded:timestamp:).md)
- [init(element:fromIntegerTruncatingIfNeeded:timestamp:)](corehid/hidelement/value/init(element:fromintegertruncatingifneeded:timestamp:).md)
- [element](corehid/hidelement/value/element.md)

### Get element data and values

- [bytes](corehid/hidelement/value/bytes.md)
- [integerValue(asTypeTruncatingIfNeeded:)](corehid/hidelement/value/integervalue(astypetruncatingifneeded:).md)
- [logicalValue(asTypeTruncatingIfNeeded:)](corehid/hidelement/value/logicalvalue(astypetruncatingifneeded:).md)
- [physicalValue(fromTypeTruncatingIfNeeded:as:)](corehid/hidelement/value/physicalvalue(fromtypetruncatingifneeded:as:).md)
- [timestamp](corehid/hidelement/value/timestamp.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Interaction

- [Communicating with human interface devices](corehid/communicatingwithhiddevices.md)
- [HIDDeviceClient](corehid/hiddeviceclient.md)
- [HIDElement](corehid/hidelement.md)
- [HIDElementCollection](corehid/hidelementcollection.md)
- [HIDElementUpdate](corehid/hidelementupdate.md)
- [HIDReportType](corehid/hidreporttype.md)
- [HIDReportID](corehid/hidreportid.md)
- [HIDUsage](corehid/hidusage.md)
- [HIDDeviceError](corehid/hiddeviceerror.md)
- [HIDDeviceTransport](corehid/hiddevicetransport.md)
- [HIDDeviceLocalizationCode](corehid/hiddevicelocalizationcode.md)
