> ## 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.

# Gyroscope

> Gyroscope

# Gyroscope

一种传感器控件，将设备的物理运动映射到一组指定的轴。

## 属性

`type` - "gyroscope"

`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]
>
> 陀螺仪控件可能并非在所有支持触控布局的设备上都可用。

与[`touchpad`](https://devdocs.xbox.com/zh-CN/reference/system/touchadaptationkit/controls/game-streaming-touch-touchpad) 类似，陀螺仪通常用于第一人称/第三人称视角游戏中，控制玩家的视角摄像机。通过调优，使用陀螺仪可以为玩家控制带来类似鼠标的精确度。

## 示例

```JSON theme={null}
使用指定的灵敏度，将设备的运动映射到右操纵杆。
{
    "type": "gyroscope",
    "axis": {
        "input": "axisXY",
        "output": "rightJoystick",
        "sensitivity": 0.3
    },
}
```

```JSON theme={null}
使用指定的灵敏度，将设备的运动映射到相对鼠标运动。
{
    "type": "gyroscope",
    "axis": {
        "input": "axisXY",
        "output": "relativeMouse",
        "sensitivity": 6.3
    },
}
```

## 要求

**布局版本：** 1.0+


## Related topics

- [A designer's guide to building touch controls](https://devdocs.xbox.com/build/core-features/common/game-streaming/building-touch-layouts/game-streaming-tak-designers-guide.md)
- [Guide du concepteur pour la création de commandes tactiles](https://devdocs.xbox.com/fr/build/core-features/common/game-streaming/building-touch-layouts/game-streaming-tak-designers-guide.md)
- [Touch Adaptation Kit](https://devdocs.xbox.com/reference/system/touchadaptationkit/touchadaptationkit-reference.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)
