<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreHID",
  "identifier" : "/documentation/CoreHID/HIDElement/Value/init(element:fromLogicalValueTruncatingIfNeeded:timestamp:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core HID",
      "CoreHID"
    ],
    "preciseIdentifier" : "s:7CoreHID10HIDElementV5ValueV7element011fromLogicalD18TruncatingIfNeeded9timestampAESgAC_x12_Concurrency15SuspendingClockV7InstantVtcs17FixedWidthIntegerRzlufc"
  },
  "title" : "init(element:fromLogicalValueTruncatingIfNeeded:timestamp:)"
}
-->

# init(element:fromLogicalValueTruncatingIfNeeded:timestamp:)

Creates a HID element value from a logical value.

```
init?<IntegerType>(element: HIDElement, fromLogicalValueTruncatingIfNeeded: IntegerType, timestamp: SuspendingClock.Instant) where IntegerType : FixedWidthInteger
```

## Parameters

`element`

The element associated with this value.

`fromLogicalValueTruncatingIfNeeded`

An integer to use for the value’s [`bytes`](/documentation/CoreHID/HIDElement/Value/bytes), truncating or extending the bytes as necessary.

`timestamp`

The time that the value was created.

## Discussion

The raw value and physical value are calculated; both must be valid.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)