---
title: "游戏 Game / Pad"
description: "版本、平台、按键与作弊串"
---

---
title: 游戏 Game / Pad
description: 版本、平台、按键与作弊串
---

`sa` · 扩展 `CLEO` · 需 CLEO

版本、平台、按键、作弊串。

写法见 [Lua](/docs/cleo/syntax) / [Redux](/docs/cleo/syntax-redux)。

## 是否原版

<Opcode id="0AA9" name="IS_GAME_VERSION_ORIGINAL" member="Game.IsVersionOriginal">
是否原版 1.0。用在 `if` 里。

```text
0AA9 IS_GAME_VERSION_ORIGINAL
```

```lua
if isGameVersionOriginal() then
end
```

```js
if (Game.isVersionOriginal()) {
}
```
</Opcode>

## 取平台

<Opcode id="0DD5" name="GET_PLATFORM" member="Game.GetPlatform">
当前平台标识（PC / Android / Xbox 等）。

```text
0DD5 GET_PLATFORM
out: platform
```

```lua
local platform = getPlatform()
```

```js
const platform = Game.getPlatform()
```
</Opcode>

## 按键是否按下

<Opcode id="0AB0" name="IS_KEY_PRESSED" member="Pad.IsKeyPressed">
指定虚拟键码是否按下。用在 `if` 里。

```text
0AB0 IS_KEY_PRESSED
in: keyCode
```

```lua
if isKeyPressed(0x20) then -- space
end
```

```js
if (Pad.isKeyPressed(keyCode)) {
}
```
</Opcode>

## 测试作弊串

<Opcode id="0ADC" name="TEST_CHEAT" member="Pad.TestCheat">
键盘是否刚打出指定作弊串。用在 `if` 里。

```text
0ADC TEST_CHEAT
in: input
```

```lua
if testCheat("HESOYAM") then
end
```

```js
if (Pad.testCheat(input)) {
}
```
</Opcode>