扩展

按键 KeyCheck

边沿检测与延迟连发

KeyCheck.h · 全局类,不在 plugin:: 命名空间。

每帧刷新

Update

在逻辑帧里先调用,刷新当前 / 上一帧键状态。

static void Update();

检测按键

Check / CheckJustDown / CheckJustUp / CheckWithDelay
  • Check:当前是否按住
  • CheckJustDown / CheckJustUp:边沿
  • CheckWithDelay:按住连发(毫秒)

仅需「是否按下」且不要边沿时,可用 plugin::KeyPressed(见 杂项工具)。

static bool Check(unsigned int key);
static bool CheckJustDown(unsigned int key);
static bool CheckJustUp(unsigned int key);
static bool CheckWithDelay(unsigned int key, unsigned int time); // III/VC/SA

On this page