@witchcraft/spellcraft
    Preparing search index...

    Interface Keys<TEntries>

    interface Keys<TEntries extends Record<string, Key> = Record<string, Key>> {
        autoManageLayout: boolean;
        entries: TEntries;
        layout: { x: number; y: number };
        nativeModifierKeys: string[];
        nativeToggleKeys: string[];
        toggles: Record<string, Key>;
        type: "keys";
        variants: Record<string, Key["id"][]>;
    }

    Type Parameters

    • TEntries extends Record<string, Key> = Record<string, Key>
    Index

    Properties

    autoManageLayout: boolean

    If this is true, calculateLayout will be used to recalculate the size of the keyboard in key units when any related key properties are changed, or when keys are added or removed.

    entries: TEntries

    The key entries.

    To add/remove entries you should addKey/removeKey or setKeysProp with the synthetic entries@add/remove properties.

    The synthetic properties can be hooked into with Manager.hooks.

    layout: { x: number; y: number }

    The layout size in pixels. Useful for rendering the layout.

    calculateLayout can be used to calculate it. This is semi-automated if Keys.autoManageLayout is true. See it for details.

    nativeModifierKeys: string[]

    Is used to keep track of native modifier keys.

    nativeToggleKeys: string[]

    Is used to keep track of native toggle keys.

    toggles: Record<string, Key>

    Is used to keep track of key toggles: Record<toggleOn/OffId, Key.id>.

    type: "keys"
    variants: Record<string, Key["id"][]>

    Is used to keep track of key variants in a record: Record<VariantName, Key.id[]>.