> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Accelerometer

> Accelerometer (Experimental)

# Accelerometer (Experimental)

一种传感器控件，将客户端设备的加速度计（若可用）映射到一组指定的轴。

> [!WARNING]
>
> 加速度计控件目前以实验形式提供，可能会根据早期使用者的反馈更改其行为。

## 属性

`type` - "accelerometer"

`axis` - *object* 或 *array*。描述此触控板控件映射关系的单个[轴](https://devdocs.xbox.com/zh-CN/reference/system/touchadaptationkit/types/game-streaming-touch-axis)或[轴](https://devdocs.xbox.com/zh-CN/reference/system/touchadaptationkit/types/game-streaming-touch-axis)数组。

## 备注

> [!WARNING]
>
> 加速度计控件可能并非在所有支持触控布局的设备上都可用。

`accelerometer` 控件可用于在能够提供加速度计支持的设备上提供优化体验。

## 示例

```JSON theme={null}
使用指定的灵敏度，将设备的加速度映射到右操纵杆的 Y 轴。
{
    "type": "accelerometer",
    "axis": {
        "input": "axisY",
        "output": "rightJoystick",
        "sensitivity": 3.5
    },
}
```

## 要求

**布局版本：** 1.0+


## Related topics

- [Touch Adaptation Kit](https://devdocs.xbox.com/reference/system/touchadaptationkit/touchadaptationkit-reference.md)
- [Touch Adaptation Kit (TAK) Reference](https://devdocs.xbox.com/build/core-features/common/game-streaming/game-streaming-touch-touch-adaptation-kit-overview.md)
- [GameInputSensorsKind](https://devdocs.xbox.com/reference/input/gameinput/enums/gameinputsensorskind.md)
- [IGameInputReading::GetMotionState (Deprecated)](https://devdocs.xbox.com/reference/input/gameinput/deprecated/interfaces/igameinputreading/methods/igameinputreading_getmotionstate.md)
- [GameInputMotionState (Deprecated)](https://devdocs.xbox.com/reference/input/gameinput/deprecated/structs/gameinputmotionstate.md)
