UNPKG

karabiner.ts-greg-mods

Version:
61 lines (60 loc) 2.4 kB
import { BasicManipulator, LayerKeyParam, FromAndToKeyCode, SideModifierAlias, KeyAlias, Rule, Condition, ConditionBuilder } from "karabiner.ts"; import { BasicManipulatorBuilder, FromAndToKeyParam } from "./karabiner-extra"; export declare class ModTapLayerBuilder { private mod; private hold_tap_layer_builder; private isLazy; constructor(key: LayerKeyParam, mod: SideModifierAlias); /** * Allows any modifiers to be used with the layer key. */ allowAnyModifiers(): this; /** * Sets the description for the rule. */ description(description: string): this; /** * Sets the tapping term in milliseconds. * * The tapping term is the time in milliseconds that the key must be held * down in order to be fully active. */ tappingTerm(tappingTermMs: number): this; /** * Sets rule-wide conditions. */ condition(...cs: Array<Condition | ConditionBuilder>): this; /** * Sets whether the modifier should be sent lazily. */ lazy(val: boolean): this; build(): Rule; holdOnOtherKeyPressManipulator(arg: Parameters<typeof this.hold_tap_layer_builder.holdOnOtherKeyPressManipulator>[0]): this; holdOnOtherKeyPressManipulators(arg: Parameters<typeof this.hold_tap_layer_builder.holdOnOtherKeyPressManipulators>[0]): this; /** * Adds hold on other key press keys to the layer. * * HOOKP keys immediately send the key with the layer's modifier. */ holdOnOtherKeyPressKeys(keys: Array<FromAndToKeyCode | KeyAlias>): this; permissiveHoldManipulators(...manipulators: (BasicManipulator | BasicManipulatorBuilder)[]): this; /** * Adds a permissive hold key to the layer. */ permissiveHoldKey(from: FromAndToKeyParam): this; permissiveHoldKeys(...keys: Array<FromAndToKeyParam>): this; /** * Adds slow keys to the layer. * * Slow keys act as normal keys when tapped before the tapping term. * * Registering a slow key is necessary, because the if-held-down event can be * interrupted, e.g., by a permissive-hold key. */ slowKeys(keys: Array<FromAndToKeyParam>): this; slowManipulators(...manipulators: BasicManipulator[]): this; } /** * Creates a builder for the mod-tap layer. */ export declare function modTapLayer(key: LayerKeyParam, mod: SideModifierAlias): ModTapLayerBuilder;