Skip to content

热键系统

统一接管客户端热键,支持服务端下发规则与 UI 侧快捷键编排。

架构总览

Behemiron 热键系统分为两类:

  • 服务端热键:服务端下发配置,客户端命中后回传服务端执行 Kether。
  • UI 热键:客户端 UI 脚本注册,仅在当前 UI 上下文生效。

UI 打开时,服务端热键默认不触发;UI 热键与服务端热键隔离。

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

客户端:UI 脚本注册热键

js
const id = Hotkeys.register({
  pattern: "CTRL+K",
  trigger: "press",
  consume: true
}, (payload) => {
  console.log("热键触发", payload.pattern)
})

模块清单

子模块职责链接
服务端配置contexts / bindings YAML 配置服务端配置
UI 热键 API客户端 JS 脚本中 Hotkeys.* 接口UI 热键 API