@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
49 lines (46 loc) • 2.04 kB
JavaScript
import { u as RegisterClass } from './index-MZPybX0H.esm.js';
import { a as RichTypeBoolean } from './declarationMapper-CqO08-WM.esm.js';
import { F as FlowGraphKeyboardEventBlock } from './flowGraphKeyboardEventBlock-BW_ut8-0.esm.js';
import './KHR_interactivity-CEwUaqxQ.esm.js';
import './objectModelMapping-De5EKNEZ.esm.js';
import './spotLight.pure-CRdZC6Ci.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-BeU0bkHj.esm.js.map