Skip to content

服务端配置

服务端热键使用 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
字段类型默认值说明
priorityint0上下文默认优先级

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
字段类型默认值说明
contextstringdefault所属上下文
pattern / keysstring--热键模式,必填
triggerstringpresspress / release / hold
consumebooleantrue命中后是否阻断后续匹配
sequenceIntervalMs / sequenceIntervalint320连招步进最大间隔(ms)
holdMs / holdintnull按住触发阈值(ms)
cooldownMs / cooldownint0冷却时间(ms)
priorityint继承 context优先级(越大越先触发)
action / scriptstring / 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. 注意事项

  1. pattern/keys 缺失时该 binding 会被跳过。
  2. action/script 缺失时该 binding 会被跳过。
  3. 未声明的 context 会报警,但配置仍可加载。
  4. UI 打开时,服务端热键默认不触发(由客户端输入层隔离)。