<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SensorKit",
  "identifier" : "/documentation/SensorKit/SRKeyboardMetrics",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SensorKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SRKeyboardMetrics"
  },
  "title" : "SRKeyboardMetrics"
}
-->

# SRKeyboardMetrics

The configuration of a device’s keyboard and its usage patterns.

```
class SRKeyboardMetrics
```

## Overview

The [`keyboardMetrics`](/documentation/SensorKit/SRSensor/keyboardMetrics) sensor provides this class as its [`sample`](/documentation/SensorKit/SRFetchResult/sample) type.

## Topics

### Inspecting Keyboard Configuration and Sessions

[`duration`](/documentation/SensorKit/SRKeyboardMetrics/duration)

The duration that the report spans.

[`keyboardIdentifier`](/documentation/SensorKit/SRKeyboardMetrics/keyboardIdentifier)

The identifier of the keyboard in the keyboard list.

[`version`](/documentation/SensorKit/SRKeyboardMetrics/version)

The version of keyboard metrics.

[`width`](/documentation/SensorKit/SRKeyboardMetrics/width)

The width, in millimeters, of the keyboard in the report.

[`height`](/documentation/SensorKit/SRKeyboardMetrics/height)

The height, in millimeters, of the keyboard in the report.

[`inputModes`](/documentation/SensorKit/SRKeyboardMetrics/inputModes)

The active keyboard languages in the session.

[`sessionIdentifiers`](/documentation/SensorKit/SRKeyboardMetrics/sessionIdentifiers)

The identifiers for the keyboard sessions that report metrics to the sample.

### Quantifying Key Use

[`totalWords`](/documentation/SensorKit/SRKeyboardMetrics/totalWords)

The total number of typed words for the keyboard.

[`totalAlteredWords`](/documentation/SensorKit/SRKeyboardMetrics/totalAlteredWords)

The total number of altered words for the keyboard.

[`totalTaps`](/documentation/SensorKit/SRKeyboardMetrics/totalTaps)

The total number of taps for the keyboard.

[`totalDrags`](/documentation/SensorKit/SRKeyboardMetrics/totalDrags)

The total number of drags for the keyboard.

[`totalDeletes`](/documentation/SensorKit/SRKeyboardMetrics/totalDeletes)

The total number of deletions for the keyboard.

[`totalEmojis`](/documentation/SensorKit/SRKeyboardMetrics/totalEmojis)

The total number of emojis for the keyboard.

[`totalPaths`](/documentation/SensorKit/SRKeyboardMetrics/totalPaths)

The total number of completed paths for the keyboard.

[`totalPathTime`](/documentation/SensorKit/SRKeyboardMetrics/totalPathTime)

The total time to complete paths for the keyboard.

[`totalPathLength`](/documentation/SensorKit/SRKeyboardMetrics/totalPathLength)

The total length of completed paths for the keyboard.

[`totalAutoCorrections`](/documentation/SensorKit/SRKeyboardMetrics/totalAutoCorrections)

The total number of autocorrections for the keyboard.

[`totalSpaceCorrections`](/documentation/SensorKit/SRKeyboardMetrics/totalSpaceCorrections)

The total number of space corrections for the keyboard.

[`totalRetroCorrections`](/documentation/SensorKit/SRKeyboardMetrics/totalRetroCorrections)

The total number of retro corrections for the keyboard.

[`totalTranspositionCorrections`](/documentation/SensorKit/SRKeyboardMetrics/totalTranspositionCorrections)

The total number of transposition corrections for the keyboard.

[`totalInsertKeyCorrections`](/documentation/SensorKit/SRKeyboardMetrics/totalInsertKeyCorrections)

The total number of Insert key corrections for the keyboard.

[`totalSkipTouchCorrections`](/documentation/SensorKit/SRKeyboardMetrics/totalSkipTouchCorrections)

The total number of skip touch corrections for the keyboard.

[`totalNearKeyCorrections`](/documentation/SensorKit/SRKeyboardMetrics/totalNearKeyCorrections)

The total number of near key corrections for the keyboard.

[`totalSubstitutionCorrections`](/documentation/SensorKit/SRKeyboardMetrics/totalSubstitutionCorrections)

The total number of substitution corrections for the keyboard.

[`totalHitTestCorrections`](/documentation/SensorKit/SRKeyboardMetrics/totalHitTestCorrections)

The total number of hit test corrections for the keyboard.

[`totalTypingDuration`](/documentation/SensorKit/SRKeyboardMetrics/totalTypingDuration)

The total amount of typing time for the keyboard.

[`totalPathPauses`](/documentation/SensorKit/SRKeyboardMetrics/totalPathPauses)

The total number of pauses while drawing a path for a word.

[`totalPauses`](/documentation/SensorKit/SRKeyboardMetrics/totalPauses)

The total number of pauses during the session.

[`totalTypingEpisodes`](/documentation/SensorKit/SRKeyboardMetrics/totalTypingEpisodes)

The total number of continuous typing episodes during the session.

### Timing Key Use

[`SRKeyboardMetrics.ProbabilityMetric`](/documentation/SensorKit/SRKeyboardMetrics/ProbabilityMetric)

A likelihood of occurrence.

[`touchDownUp`](/documentation/SensorKit/SRKeyboardMetrics/touchDownUp)

The duration between touch down to touch up for any key.

[`touchUpDown`](/documentation/SensorKit/SRKeyboardMetrics/touchUpDown)

The duration between touch up and touch down for any key.

[`spaceTouchDownUp`](/documentation/SensorKit/SRKeyboardMetrics/spaceTouchDownUp)

The duration between touch down and touch up of all Space bar events for the keyboard.

[`deleteTouchDownUp`](/documentation/SensorKit/SRKeyboardMetrics/deleteTouchDownUp)

The duration between touch down and touch up of all Delete key events for the keyboard.

[`shortWordCharKeyTouchDownUp`](/documentation/SensorKit/SRKeyboardMetrics/shortWordCharKeyTouchDownUp)

The duration between touch down and touch up of all character keys in short words for the keyboard.

[`touchDownDown`](/documentation/SensorKit/SRKeyboardMetrics/touchDownDown)

The duration between touch down and touch down for any key.

[`charKeyToPrediction`](/documentation/SensorKit/SRKeyboardMetrics/charKeyToPrediction)

The duration between touch up on a character key and touch down on a word in the prediction bar.

[`shortWordCharKeyToCharKey`](/documentation/SensorKit/SRKeyboardMetrics/shortWordCharKeyToCharKey)

The duration between touch up on a character key and touch down on any sequential character key in a short word.

[`charKeyToAnyTapKey`](/documentation/SensorKit/SRKeyboardMetrics/charKeyToAnyTapKey)

The duration between touch up on a character key and touch down on the next sequential key.

[`anyTapToCharKey`](/documentation/SensorKit/SRKeyboardMetrics/anyTapToCharKey)

The duration between touch up of any key and touch down on a sequential character key.

[`spaceToCharKey`](/documentation/SensorKit/SRKeyboardMetrics/spaceToCharKey)

The duration between touch up of the Space bar and touch down of a sequential character key.

[`charKeyToSpaceKey`](/documentation/SensorKit/SRKeyboardMetrics/charKeyToSpaceKey)

The duration between touch up of a character key and touch down of a sequential Space bar.

[`spaceToDeleteKey`](/documentation/SensorKit/SRKeyboardMetrics/spaceToDeleteKey)

The duration between touch up of the Space bar and touch down of a sequential Delete key.

[`deleteToSpaceKey`](/documentation/SensorKit/SRKeyboardMetrics/deleteToSpaceKey)

The duration between touch up of the Delete key and touch down of a sequential Space bar.

[`spaceToSpaceKey`](/documentation/SensorKit/SRKeyboardMetrics/spaceToSpaceKey)

The duration between touch up of the Space bar and touch down of a sequential Space bar.

[`spaceToShiftKey`](/documentation/SensorKit/SRKeyboardMetrics/spaceToShiftKey)

The duration between touch up of the Space bar and touch down of a sequential Shift key.

[`spaceToPlaneChangeKey`](/documentation/SensorKit/SRKeyboardMetrics/spaceToPlaneChangeKey)

The duration between touch up of the Space bar and touch down of a sequential plane change key.

[`spaceToPredictionKey`](/documentation/SensorKit/SRKeyboardMetrics/spaceToPredictionKey)

The duration between touch up of the Space bar and touch down of a sequential selection from the prediction bar.

[`deleteToCharKey`](/documentation/SensorKit/SRKeyboardMetrics/deleteToCharKey)

The duration between touch up of the Delete key and touch down of a sequential character key.

[`charKeyToDelete`](/documentation/SensorKit/SRKeyboardMetrics/charKeyToDelete)

The duration between touch up of a character key and touch down of a sequential Delete key.

[`deleteToDelete`](/documentation/SensorKit/SRKeyboardMetrics/deleteToDelete)

The duration between touch up of the Delete key and touch down of a sequential Delete key.

[`deleteToDeletes`](/documentation/SensorKit/SRKeyboardMetrics/deleteToDeletes)

The duration between touch up of the Delete key and touch down of a sequential Delete key for an entire word.

[`deleteToShiftKey`](/documentation/SensorKit/SRKeyboardMetrics/deleteToShiftKey)

The duration between touch up of the Delete key and touch down of a sequential Shift key.

[`deleteToPlaneChangeKey`](/documentation/SensorKit/SRKeyboardMetrics/deleteToPlaneChangeKey)

The duration between touch up of the Delete key and touch down of a sequential plane change key.

[`anyTapToPlaneChangeKey`](/documentation/SensorKit/SRKeyboardMetrics/anyTapToPlaneChangeKey)

The duration between touch up of any key and touch down on a plane change key.

[`planeChangeToAnyTap`](/documentation/SensorKit/SRKeyboardMetrics/planeChangeToAnyTap)

The duration between touch up on a plane change key and touch down on the next sequential key.

[`charKeyToPlaneChangeKey`](/documentation/SensorKit/SRKeyboardMetrics/charKeyToPlaneChangeKey)

The duration between touch up of a character key and touch down of a sequential plane change key.

[`planeChangeKeyToCharKey`](/documentation/SensorKit/SRKeyboardMetrics/planeChangeKeyToCharKey)

The duration between touch up of a plane change key and touch down of any key.

[`deleteToPath`](/documentation/SensorKit/SRKeyboardMetrics/deleteToPath)

The duration between touch up of the Delete key and touch down of a sequential path.

[`pathToDelete`](/documentation/SensorKit/SRKeyboardMetrics/pathToDelete)

The duration between touch up of the Delete key and touch down of a continuous path.

[`spaceToPath`](/documentation/SensorKit/SRKeyboardMetrics/spaceToPath)

The duration between touch up of the Space bar and touch down to begin a sequential path.

[`pathToSpace`](/documentation/SensorKit/SRKeyboardMetrics/pathToSpace)

The duration between touch up of a path and touch down of a sequential Space bar.

[`pathToPath`](/documentation/SensorKit/SRKeyboardMetrics/pathToPath)

The duration between touch up of a path and touch down of a sequential path.

[`longWordTouchDownUp`](/documentation/SensorKit/SRKeyboardMetrics/longWordTouchDownUp)

The duration between touch down and touch up of the character keys of all the long words in the session.

[`longWordTouchDownDown`](/documentation/SensorKit/SRKeyboardMetrics/longWordTouchDownDown)

The duration between touch down and touch down of the character keys of all the long words in the session.

[`longWordTouchUpDown`](/documentation/SensorKit/SRKeyboardMetrics/longWordTouchUpDown)

The duration between touch up and touch down of the character keys of all the long words in the session.

[`pathTypingSpeed`](/documentation/SensorKit/SRKeyboardMetrics/pathTypingSpeed)

The QuickType words per minute in the session.

[`typingSpeed`](/documentation/SensorKit/SRKeyboardMetrics/typingSpeed)

The user’s typing rate in characters per second.

### Measuring Key Use

[`longWordUpErrorDistance`](/documentation/SensorKit/SRKeyboardMetrics/longWordUpErrorDistance)

The distance from the touch up to the center of the intended key of the characters of a long word.

[`longWordDownErrorDistance`](/documentation/SensorKit/SRKeyboardMetrics/longWordDownErrorDistance)

The distance from the touch down to the center of the intended key of the characters of a long word.

[`upErrorDistance`](/documentation/SensorKit/SRKeyboardMetrics/upErrorDistance)

The distance from the touch up to the center of any key.

[`downErrorDistance`](/documentation/SensorKit/SRKeyboardMetrics/downErrorDistance)

The distance from the touch down to the center of any key.

[`spaceUpErrorDistance`](/documentation/SensorKit/SRKeyboardMetrics/spaceUpErrorDistance)

The distance from the touch up to the right centroid of the Space bar.

[`spaceDownErrorDistance`](/documentation/SensorKit/SRKeyboardMetrics/spaceDownErrorDistance)

The distance from the touch down to the right centroid of the Space bar.

[`deleteUpErrorDistance`](/documentation/SensorKit/SRKeyboardMetrics/deleteUpErrorDistance)

The distance from the touch up to the center of the Delete key.

[`deleteDownErrorDistance`](/documentation/SensorKit/SRKeyboardMetrics/deleteDownErrorDistance)

The distance from the touch down to the center of the Delete key.

[`shortWordCharKeyUpErrorDistance`](/documentation/SensorKit/SRKeyboardMetrics/shortWordCharKeyUpErrorDistance)

The distance from the touch up to the center of the intended key of a character in a short word.

[`shortWordCharKeyDownErrorDistance`](/documentation/SensorKit/SRKeyboardMetrics/shortWordCharKeyDownErrorDistance)

The distance from the touch down to the center of the intended key of a character in a short word.

[`pathErrorDistanceRatio`](/documentation/SensorKit/SRKeyboardMetrics/pathErrorDistanceRatio)

Sample values of the ratio of error distance between the intended and actual path.

### Inferring Sentiment

[`wordCount(for:)`](/documentation/SensorKit/SRKeyboardMetrics/wordCount(for:))

Provides the number of typed words for the specified sentiment in the report.

[`emojiCount(for:)`](/documentation/SensorKit/SRKeyboardMetrics/emojiCount(for:))

Provides the number of typed emojis for the specified sentiment in the report.

[`SRKeyboardMetrics.SentimentCategory`](/documentation/SensorKit/SRKeyboardMetrics/SentimentCategory)

Moods that the framework determines by analyzing the user’s input.



---

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)