Interface HotkeyCaptureWrapper

A hotkey capture element that displays the currently bound key combo and lets the user rebind it by pressing a new combination.

const capture = UI.AddHotkeyCapture("trigger", "Trigger key", "Ctrl+Shift+T");
capture.OnChange((combo) => { Console.Log("new combo: " + combo); });
interface HotkeyCaptureWrapper {
    Hide(): void;
    Show(): void;
    Destroy(): void;
    GetValue(): string;
    SetValue(val: string): void;
    OnChange(callback: (newValue: string) => void): void;
    OnPressed(callback: () => void): void;
}

Hierarchy (View Summary)

Methods

  • Hides the element without destroying it. Call Show() to make it visible again.

    Returns void

  • Makes a previously hidden element visible again.

    Returns void

  • Permanently removes the element from the UI panel.

    Returns void

  • Returns the current value of the element.

    Returns string

  • Programmatically sets the element's value. Persists to storage and triggers OnChange listeners.

    Parameters

    • val: string

    Returns void

  • Registers a callback that fires whenever the user changes the value.

    Parameters

    • callback: (newValue: string) => void

    Returns void

  • Fires when the captured combo is pressed (not just changed).

    Parameters

    • callback: () => void

    Returns void