UNPKG

karabiner.ts-greg-mods

Version:
45 lines (44 loc) 1.79 kB
import { BasicManipulator, Rule, FromModifierParam, ModifierParam, FromKeyParam, ToEvent } from "karabiner.ts"; import { FromAndToKeyParam } from "./karabiner-extra"; export declare function capsWordVarName(): string; /** * Turns the manipulator into a Caps WORD toggle. */ export declare function capsWordToggle(manipulator: BasicManipulator): BasicManipulator[]; /** * Turns the manipulator into a Caps WORD off button. */ export declare function capsWordOff(manipulator: BasicManipulator): BasicManipulator[]; export declare const disableCapsWordEvents: ToEvent[]; export declare class CapsWordBuilder { private ruleDescription; private layerManipulators; private useDefaultEscapeKeys; /** * Sets the description for the rule. */ description(description: string): this; /** * Adds a toggle. */ toggle(manipulator: BasicManipulator): this; /** * Adds a key that deactivates the Caps WORD mode. */ escapeKey(key: FromAndToKeyParam, mandatoryModifiers?: (FromModifierParam | "" | null) & ModifierParam, optionalModifiers?: FromModifierParam): this; /** * Adds an escape key without an echo. * * Useful for keys like ⎋, where the echo would often be spurious, i.e., * we only want to exit the Caps WORD mode, not some external mode. */ escapePassthroughKey(key: FromKeyParam, mandatoryModifiers?: FromModifierParam | "" | null, optionalModifiers?: FromModifierParam): this; defaultEscapeKeys(use: boolean): this; build(): Rule; } /** * A caps-word layer turns on capitalizing letters until an escape key (⎋, ␣, etc.) is pressed. * * This layer works by turning on ⇪ under the hood and registering escape keys. */ export declare function capsWord(): CapsWordBuilder;