/** * AccModel2D — time-based 2-D acceleration physics, ported from CapsLockX. * * Single source of truth: `rs/core/src/acc_model.rs` in snomiao/CapsLockX * (a JS reference lives at snomiao/capslockx.js). This is a faithful port of * the *motion* half — the `ma` acceleration curve, velocity integration and * damping — so that WASD-pan / RF-zoom in rgui feel identical to moving the * cursor with CapsLockX. The mouse-button chord logic (R+F = middle, opposite * keys = middle-click nudge) is intentionally omitted: rgui drives a viewport, * not a cursor with buttons. * * The model is FPS-independent: acceleration is a function of how long a key * has been HELD (not of frame time), and displacement is the time-integral of * velocity, so the same hold produces the same travel at any tick rate. The * caller drives it by calling `tick(now)` once per animation frame; each call * returns the float displacement accumulated since the previous tick. */ export interface AccTick { /** horizontal displacement (units) since the previous tick */ dx: number; /** vertical displacement (units) since the previous tick */ dy: number; /** true while the model is still moving or a key is held */ active: boolean; } /** * 2-D acceleration model. Press/release the four cardinal directions, then * call `tick(now)` every frame to pump the physics. `now` is any monotonic * millisecond clock (e.g. `performance.now()`); press timestamps must come * from the same clock. */ export declare class AccModel2D { private leftDown; private rightDown; private upDown; private downDown; private lastTick; private hVel; private vVel; private active; private hRate; private vRate; private maxSpeed; /** @param vRate 0 → mirror hRate (matches the AHK default). */ constructor(hRate?: number, vRate?: number, maxSpeed?: number); get isActive(): boolean; setRates(hRate: number, vRate?: number, maxSpeed?: number): void; private wake; pressLeft(now: number): void; pressRight(now: number): void; pressUp(now: number): void; pressDown(now: number): void; releaseLeft(): void; releaseRight(): void; releaseUp(): void; releaseDown(): void; /** Halt immediately and clear all held directions. */ stop(): void; /** Advance to `now`; returns displacement since the previous tick. */ tick(now: number): AccTick; } //# sourceMappingURL=accModel.d.ts.map