主题
服务端配置
服务端热键使用
contexts+bindings两段配置,位于/plugins/Behemiron/hotkeys/*.yml。
Quick Start
yaml
# /plugins/Behemiron/hotkeys/gameplay.yml
contexts:
gameplay:
priority: 10
bindings:
skill_dash:
context: gameplay
pattern: "W, W"
trigger: press
consume: true
sequenceIntervalMs: 320
cooldownMs: 500
action: |-
anim trigger dash start
sound play "ui/quest_accept"1. contexts
contexts 用于分组和默认优先级。
yaml
contexts:
gameplay:
priority: 10| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
priority | int | 0 | 上下文默认优先级 |
2. bindings
每个 binding 定义一条服务端热键规则。
yaml
bindings:
skill_dash:
context: gameplay
pattern: "W, W"
trigger: press
consume: true
sequenceIntervalMs: 320
holdMs: 300
cooldownMs: 500
priority: 10
action: |-
anim trigger dash start| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
context | string | default | 所属上下文 |
pattern / keys | string | -- | 热键模式,必填 |
trigger | string | press | press / release / hold |
consume | boolean | true | 命中后是否阻断后续匹配 |
sequenceIntervalMs / sequenceInterval | int | 320 | 连招步进最大间隔(ms) |
holdMs / hold | int | null | 按住触发阈值(ms) |
cooldownMs / cooldown | int | 0 | 冷却时间(ms) |
priority | int | 继承 context | 优先级(越大越先触发) |
action / script | string / list<string> | -- | 触发后执行的 Kether 脚本,必填 |
3. pattern 语法
| 语法 | 写法 | 说明 |
|---|---|---|
| 连招 | "W, W" | 依序按下 |
| 组合键 | "CTRL+K" | 同时按下 |
| 按住 | "F@300" | 按住 300ms |
| 组合按住 | "SHIFT+RMB@600" | 组合 + 按住 |
4. action 写法
支持三种形式:
yaml
# 1) action 单字符串
action: "anim trigger dash start"
# 2) action 多行
action: |-
anim trigger dash start
sound play "ui/quest_accept"
# 3) script 别名
script:
- anim trigger dash start
- sound play "ui/quest_accept"5. 注意事项
pattern/keys缺失时该 binding 会被跳过。action/script缺失时该 binding 会被跳过。- 未声明的
context会报警,但配置仍可加载。 - UI 打开时,服务端热键默认不触发(由客户端输入层隔离)。