import { R as RegisterClass } from './index-BvJBnIUK.esm.js';
import { b as RichTypeBoolean } from './declarationMapper-CyxdrUFP.esm.js';
import { F as FlowGraphKeyboardEventBlock } from './flowGraphKeyboardEventBlock-Dz8yDt6q.esm.js';
import './KHR_interactivity-BGk_Crki.esm.js';
import './objectModelMapping-BtiDAwYm.esm.js';

/**
 * A keyboard event block that fires when a key is pressed down.
 * Extends {@link FlowGraphKeyboardEventBlock} with an `isRepeat` output
 * and an `ignoreRepeat` configuration option.
 */
class FlowGraphKeyDownEventBlock extends FlowGraphKeyboardEventBlock {
    /**
     * Creates a new FlowGraphKeyDownEventBlock.
     * @param config optional configuration
     */
    constructor(config) {
        super(config);
        /** @internal */
        this.type = "KeyDown" /* FlowGraphEventType.KeyDown */;
        this.isRepeat = this.registerDataOutput("isRepeat", RichTypeBoolean);
    }
    /** @internal */
    _executeEvent(context, keyboardInfo) {
        const repeat = keyboardInfo.event.repeat ?? false;
        // Skip auto-repeat events when configured to do so.
        if (repeat && this.config?.ignoreRepeat) {
            return true;
        }
        // Set the repeat output before delegating to the base class,
        // which calls _execute() and fires signals — downstream blocks
        // must see the correct value during that execution chain.
        this.isRepeat.setValue(repeat, context);
        // Delegate to the base class for key filtering, output population, and execution.
        return super._executeEvent(context, keyboardInfo);
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FlowGraphKeyDownEventBlock" /* FlowGraphBlockNames.KeyDownEvent */;
    }
}
RegisterClass("FlowGraphKeyDownEventBlock" /* FlowGraphBlockNames.KeyDownEvent */, FlowGraphKeyDownEventBlock);

export { FlowGraphKeyDownEventBlock };
//# sourceMappingURL=flowGraphKeyDownEventBlock-OR5gQHcP.esm.js.map
