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

# GameInputKeyState

> GameInputKeyState

# GameInputKeyState

描述遊戲控制器上作用中按鍵的狀態。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
struct GameInputKeyState
{
    uint32_t scanCode;
    uint32_t codePoint;
    uint8_t  virtualKey;
    bool     isDeadKey;
};
```

<a id="membersSection" />

### 成員

*scanCode*<br />
類型：uint32\_t

按鍵的掃描碼。

*codePoint*<br />
類型：uint32\_t

按鍵上實體字符的 Unicode 字碼指標。

*virtualKey*<br />
類型：uint8\_t

虛擬按鍵碼。

*isDeadKey*<br />
類型：bool

表示按鍵是否為無效按鍵。(無效按鍵會修改下一次按鍵輸入所產生的字元。)

<a id="remarksSection" />

## 備註

此結構由 [IGameInputReading::GetKeyState](/zh-TW/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getkeystate) 方法使用。`GetKeyState` 僅用於將鍵盤輸入對應到遊戲動作，而不適用於一般文字輸入。

如需詳細資訊，請參閱 [GameInput 讀數](/zh-TW/build/core-features/common/input/overviews/input-readings)。

<a id="requirementsSection" />

## 需求

**標頭：** GameInput.h

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

<a id="seealsoSection" />

## 概念文件

* [GameInput 鍵盤和滑鼠](/zh-TW/build/core-features/common/input/advanced/input-keyboard-mouse)

## 另請參閱

[GameInput 概觀](/zh-TW/build/core-features/common/input/overviews/input-overview)\
[GameInput](/zh-TW/reference/input/gameinput/gameinput_members)

## 版本歷程記錄

| 版本 | 變更 |
| - | - |
| **v0** | 推出。 |


## Related topics

- [GameInputKeyState](/reference/input/gameinput/structs/gameinputkeystate.md)
- [IGameInputReading::GetKeyState](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getkeystate.md)
- [Keyboards and mice in GameInput](/build/core-features/common/input/advanced/input-keyboard-mouse.md)
- [GameInput](/reference/input/gameinput/gameinput_members.md)
