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

# init(element:fromIntegerTruncatingIfNeeded:timestamp:)

Creates an HID element value from an integer.

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

## Parameters

`element`

The element associated with this value.

`fromIntegerTruncatingIfNeeded`

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 logical and physical values are calculated, but don’t need to 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)