@onerjs/core 8.55.8 → 8.55.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animation.pure.js +2 -2
- package/Animations/animation.pure.js.map +1 -1
- package/Animations/runtimeAnimation.js +4 -0
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Meshes/followBehavior.js +1 -0
- package/Behaviors/Meshes/followBehavior.js.map +1 -1
- package/Behaviors/Meshes/surfaceMagnetismBehavior.js +1 -0
- package/Behaviors/Meshes/surfaceMagnetismBehavior.js.map +1 -1
- package/Cameras/Inputs/followCameraMouseWheelInput.js +2 -2
- package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/followCameraPointersInput.d.ts +15 -0
- package/Cameras/Inputs/followCameraPointersInput.js +18 -3
- package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js +1 -1
- package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicUniversalCamera.pure.js +1 -1
- package/Cameras/Stereoscopic/stereoscopicUniversalCamera.pure.js.map +1 -1
- package/Cameras/arcRotateCamera.pure.js +1 -1
- package/Cameras/arcRotateCamera.pure.js.map +1 -1
- package/Collisions/gpuPicker.d.ts +1 -0
- package/Collisions/gpuPicker.js +5 -4
- package/Collisions/gpuPicker.js.map +1 -1
- package/Culling/Helper/boundingInfoHelper.js +1 -1
- package/Culling/Helper/boundingInfoHelper.js.map +1 -1
- package/Culling/boundingSphere.js +7 -4
- package/Culling/boundingSphere.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js.map +1 -1
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js +48 -6
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +1 -1
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/abstractEngine.pure.js +2 -2
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/engine.d.ts +10 -1
- package/Engines/thinNativeEngine.pure.d.ts +6 -1
- package/Engines/thinNativeEngine.pure.js +29 -2
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.d.ts +3 -63
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.js +5 -71
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.pure.d.ts +71 -0
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.pure.js +86 -0
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.pure.js.map +1 -0
- package/FlowGraph/Blocks/Data/pure.d.ts +1 -0
- package/FlowGraph/Blocks/Data/pure.js +1 -0
- package/FlowGraph/Blocks/Data/pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.d.ts +3 -37
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.js +5 -39
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.pure.d.ts +45 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.pure.js +54 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.pure.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.d.ts +3 -17
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.js +5 -22
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.pure.d.ts +25 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.pure.js +37 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.pure.js.map +1 -0
- package/FlowGraph/Blocks/Event/pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/pure.js +2 -0
- package/FlowGraph/Blocks/Event/pure.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.d.ts +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.js +198 -172
- package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
- package/FrameGraph/frameGraph.js +10 -1
- package/FrameGraph/frameGraph.js.map +1 -1
- package/Gamepads/gamepadManager.d.ts +1 -0
- package/Gamepads/gamepadManager.js +5 -2
- package/Gamepads/gamepadManager.js.map +1 -1
- package/Gizmos/scaleGizmo.js +1 -0
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Lights/IES/iesLoader.js +6 -8
- package/Lights/IES/iesLoader.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.pure.js +4 -6
- package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +2 -2
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/light.js +3 -5
- package/Lights/light.js.map +1 -1
- package/Lights/spotLight.pure.js +1 -1
- package/Lights/spotLight.pure.js.map +1 -1
- package/Materials/Background/backgroundMaterial.pure.d.ts +1 -1
- package/Materials/Background/backgroundMaterial.pure.js +3 -12
- package/Materials/Background/backgroundMaterial.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +2 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.pure.js +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.pure.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.pure.d.ts +1 -1
- package/Materials/PBR/openpbrMaterial.pure.js +3 -12
- package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.pure.d.ts +1 -1
- package/Materials/PBR/pbrBaseMaterial.pure.js +3 -12
- package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.pure.js +1 -1
- package/Materials/Textures/renderTargetTexture.pure.js.map +1 -1
- package/Materials/material.pure.js +2 -2
- package/Materials/material.pure.js.map +1 -1
- package/Materials/standardMaterial.pure.d.ts +1 -1
- package/Materials/standardMaterial.pure.js +4 -13
- package/Materials/standardMaterial.pure.js.map +1 -1
- package/Maths/math.path.js +1 -1
- package/Maths/math.path.js.map +1 -1
- package/Maths/math.polar.js +1 -1
- package/Maths/math.polar.js.map +1 -1
- package/Maths/math.vector.pure.js +4 -3
- package/Maths/math.vector.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +72 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +164 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +2 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +36 -18
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.d.ts +5 -4
- package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.js +25 -8
- package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js +3 -3
- package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js.map +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js +2 -2
- package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js.map +1 -1
- package/Meshes/Node/Blocks/mappingBlock.pure.js +2 -2
- package/Meshes/Node/Blocks/mappingBlock.pure.js.map +1 -1
- package/Meshes/csg.js +5 -5
- package/Meshes/csg.js.map +1 -1
- package/Meshes/groundMesh.pure.js +1 -1
- package/Meshes/groundMesh.pure.js.map +1 -1
- package/Meshes/mesh.pure.js +2 -2
- package/Meshes/mesh.pure.js.map +1 -1
- package/Misc/deepMerger.js +1 -1
- package/Misc/deepMerger.js.map +1 -1
- package/Misc/dumpTools.pure.js +1 -1
- package/Misc/dumpTools.pure.js.map +1 -1
- package/Misc/index.d.ts +1 -0
- package/Misc/index.js +1 -0
- package/Misc/index.js.map +1 -1
- package/Misc/pure.d.ts +1 -0
- package/Misc/pure.js +1 -0
- package/Misc/pure.js.map +1 -1
- package/Misc/shaderImportLoader.d.ts +25 -0
- package/Misc/shaderImportLoader.js +54 -0
- package/Misc/shaderImportLoader.js.map +1 -0
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleClampBlock.pure.d.ts +0 -1
- package/Particles/Node/Blocks/particleClampBlock.pure.js +1 -6
- package/Particles/Node/Blocks/particleClampBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleMathBlock.pure.js +1 -1
- package/Particles/Node/Blocks/particleMathBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleNLerpBlock.pure.js +8 -3
- package/Particles/Node/Blocks/particleNLerpBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleSmoothStepBlock.pure.js +3 -2
- package/Particles/Node/Blocks/particleSmoothStepBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleStepBlock.pure.js +3 -2
- package/Particles/Node/Blocks/particleStepBlock.pure.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.js +1 -1
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js.map +1 -1
- package/PostProcesses/sharpenPostProcess.pure.js +1 -1
- package/PostProcesses/sharpenPostProcess.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.d.ts +12 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +15 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +14 -0
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +122 -6
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.d.ts +7 -0
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +17 -0
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
- package/Rendering/boundingBoxRenderer.pure.js +3 -3
- package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
- package/Rendering/outlineRenderer.pure.js +1 -0
- package/Rendering/outlineRenderer.pure.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.js +1 -1
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Rendering/subSurfaceSceneComponent.pure.d.ts +1 -1
- package/Rendering/subSurfaceSceneComponent.pure.js +1 -1
- package/Rendering/subSurfaceSceneComponent.pure.js.map +1 -1
- package/Rendering/utilityLayerRenderer.js +1 -1
- package/Rendering/utilityLayerRenderer.js.map +1 -1
- package/Shaders/gaussianSplattingVoxel.fragment.js +4 -10
- package/Shaders/gaussianSplattingVoxel.fragment.js.map +1 -1
- package/Shaders/iblCombineVoxelGrids.fragment.js +1 -1
- package/Shaders/iblCombineVoxelGrids.fragment.js.map +1 -1
- package/Shaders/iblShadowVoxelTracing.fragment.js +24 -7
- package/Shaders/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/iblVoxelOpacityAtomicMax.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/iblVoxelOpacityAtomicMax.js +13 -0
- package/ShadersWGSL/ShadersInclude/iblVoxelOpacityAtomicMax.js.map +1 -0
- package/ShadersWGSL/gaussianSplattingVoxel.fragment.js +15 -9
- package/ShadersWGSL/gaussianSplattingVoxel.fragment.js.map +1 -1
- package/ShadersWGSL/iblCombineVoxelGrids.fragment.js +1 -1
- package/ShadersWGSL/iblCombineVoxelGrids.fragment.js.map +1 -1
- package/ShadersWGSL/iblCopyVoxelBufferToGrid.compute.d.ts +5 -0
- package/ShadersWGSL/iblCopyVoxelBufferToGrid.compute.js +14 -0
- package/ShadersWGSL/iblCopyVoxelBufferToGrid.compute.js.map +1 -0
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js +24 -7
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/ShadersWGSL/iblVoxelGrid.fragment.js +26 -6
- package/ShadersWGSL/iblVoxelGrid.fragment.js.map +1 -1
- package/SmartAssets/smartAssetManager.pure.js +1 -1
- package/SmartAssets/smartAssetManager.pure.js.map +1 -1
- package/Sprites/thinSprite.js +1 -1
- package/Sprites/thinSprite.js.map +1 -1
- package/XR/features/Layers/WebXRCompositionLayer.d.ts +130 -12
- package/XR/features/Layers/WebXRCompositionLayer.js +192 -3
- package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -1
- package/XR/features/Layers/WebXRFallbackLayer.d.ts +84 -0
- package/XR/features/Layers/WebXRFallbackLayer.js +137 -0
- package/XR/features/Layers/WebXRFallbackLayer.js.map +1 -0
- package/XR/features/Layers/WebXRWebGPUCompositionLayer.d.ts +4 -4
- package/XR/features/Layers/WebXRWebGPUCompositionLayer.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.pure.d.ts +45 -0
- package/XR/features/WebXRAnchorSystem.pure.js +153 -13
- package/XR/features/WebXRAnchorSystem.pure.js.map +1 -1
- package/XR/features/WebXRLayers.pure.d.ts +171 -8
- package/XR/features/WebXRLayers.pure.js +500 -98
- package/XR/features/WebXRLayers.pure.js.map +1 -1
- package/XR/features/WebXRLayersFallback.d.ts +5 -0
- package/XR/features/WebXRLayersFallback.js +8 -0
- package/XR/features/WebXRLayersFallback.js.map +1 -0
- package/XR/features/WebXRLayersFallback.pure.d.ts +6 -0
- package/XR/features/WebXRLayersFallback.pure.js +44 -0
- package/XR/features/WebXRLayersFallback.pure.js.map +1 -0
- package/XR/features/WebXRLightEstimation.pure.d.ts +3 -4
- package/XR/features/WebXRLightEstimation.pure.js +22 -21
- package/XR/features/WebXRLightEstimation.pure.js.map +1 -1
- package/XR/features/WebXRMeshDetector.pure.d.ts +5 -0
- package/XR/features/WebXRMeshDetector.pure.js +1 -0
- package/XR/features/WebXRMeshDetector.pure.js.map +1 -1
- package/XR/features/WebXRNearInteraction.pure.js +3 -3
- package/XR/features/WebXRNearInteraction.pure.js.map +1 -1
- package/XR/features/WebXRPlaneDetector.pure.d.ts +9 -5
- package/XR/features/WebXRPlaneDetector.pure.js +12 -8
- package/XR/features/WebXRPlaneDetector.pure.js.map +1 -1
- package/XR/features/pure.d.ts +1 -0
- package/XR/features/pure.js +1 -0
- package/XR/features/pure.js.map +1 -1
- package/XR/webXRCamera.d.ts +2 -0
- package/XR/webXRCamera.js +8 -2
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXRLayerWrapper.d.ts +19 -5
- package/XR/webXRLayerWrapper.js +9 -0
- package/XR/webXRLayerWrapper.js.map +1 -1
- package/XR/webXRRenderTargetTextureProvider.d.ts +4 -4
- package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
- package/XR/webXRWebGLRenderTargetTextureProvider.d.ts +2 -1
- package/XR/webXRWebGLRenderTargetTextureProvider.js.map +1 -1
- package/XR/webXRWebGPURenderTargetTextureProvider.d.ts +3 -3
- package/XR/webXRWebGPURenderTargetTextureProvider.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.d.ts +5 -0
- package/scene.pure.js +25 -0
- package/scene.pure.js.map +1 -1
|
@@ -1,65 +1,5 @@
|
|
|
1
|
-
import { FlowGraphBlock, type IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
|
|
2
|
-
import { type FlowGraphContext } from "../../flowGraphContext.js";
|
|
3
|
-
import { type FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* This block queries the scene event coordinator's `pressedKeys` set,
|
|
9
|
-
* which is updated in real-time by the keyboard observers. It is designed
|
|
10
|
-
* to be polled every frame (e.g. from a Scene Tick event chain) but can
|
|
11
|
-
* also be read on demand from any execution context.
|
|
12
|
-
*
|
|
13
|
-
* The `key` input uses `KeyboardEvent.code` values (e.g. "KeyA", "Space",
|
|
14
|
-
* "ShiftLeft", "ControlLeft", "AltLeft", "MetaLeft" for Mac Cmd).
|
|
15
|
-
*
|
|
16
|
-
* Modifier inputs (`withShift`, `withCtrl`, `withAlt`, `withMeta`,
|
|
17
|
-
* `withCommandOrCtrl`) default to false. Set any to true to require that
|
|
18
|
-
* modifier to also be held for `isPressed` to be true.
|
|
19
|
-
* For example, key = "KeyA" + withCommandOrCtrl = true checks for
|
|
20
|
-
* Cmd+A on macOS or Ctrl+A on Windows/Linux.
|
|
2
|
+
* Re-exports pure implementation and applies runtime side effects.
|
|
3
|
+
* Import flowGraphIsKeyPressedBlock.pure for tree-shakeable, side-effect-free usage.
|
|
21
4
|
*/
|
|
22
|
-
export
|
|
23
|
-
/**
|
|
24
|
-
* Input connection: the `KeyboardEvent.code` of the key to check
|
|
25
|
-
* (e.g. "KeyA", "Space", "ShiftLeft").
|
|
26
|
-
*/
|
|
27
|
-
readonly key: FlowGraphDataConnection<string>;
|
|
28
|
-
/**
|
|
29
|
-
* Input connection: when true, Shift must also be held.
|
|
30
|
-
*/
|
|
31
|
-
readonly withShift: FlowGraphDataConnection<boolean>;
|
|
32
|
-
/**
|
|
33
|
-
* Input connection: when true, Ctrl must also be held.
|
|
34
|
-
*/
|
|
35
|
-
readonly withCtrl: FlowGraphDataConnection<boolean>;
|
|
36
|
-
/**
|
|
37
|
-
* Input connection: when true, Alt (Option on macOS) must also be held.
|
|
38
|
-
*/
|
|
39
|
-
readonly withAlt: FlowGraphDataConnection<boolean>;
|
|
40
|
-
/**
|
|
41
|
-
* Input connection: when true, Meta (Win key / Cmd) must also be held.
|
|
42
|
-
*/
|
|
43
|
-
readonly withMeta: FlowGraphDataConnection<boolean>;
|
|
44
|
-
/**
|
|
45
|
-
* Input connection: when true, the platform-appropriate "command" modifier
|
|
46
|
-
* must also be held (Cmd on macOS, Ctrl on Windows/Linux).
|
|
47
|
-
* This uses the virtual "CommandOrControl" key tracked by the coordinator.
|
|
48
|
-
*/
|
|
49
|
-
readonly withCommandOrCtrl: FlowGraphDataConnection<boolean>;
|
|
50
|
-
/**
|
|
51
|
-
* Output connection: true if the key (and all required modifiers) are currently held down.
|
|
52
|
-
*/
|
|
53
|
-
readonly isPressed: FlowGraphDataConnection<boolean>;
|
|
54
|
-
/**
|
|
55
|
-
* Creates a new FlowGraphIsKeyPressedBlock.
|
|
56
|
-
* @param config optional configuration
|
|
57
|
-
*/
|
|
58
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
59
|
-
/** @internal */
|
|
60
|
-
_updateOutputs(context: FlowGraphContext): void;
|
|
61
|
-
/**
|
|
62
|
-
* @returns class name of the block.
|
|
63
|
-
*/
|
|
64
|
-
getClassName(): string;
|
|
65
|
-
}
|
|
5
|
+
export * from "./flowGraphIsKeyPressedBlock.pure.js";
|
|
@@ -1,74 +1,8 @@
|
|
|
1
|
-
import { FlowGraphBlock } from "../../flowGraphBlock.js";
|
|
2
|
-
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
3
|
-
import { RichTypeBoolean, RichTypeString } from "../../flowGraphRichTypes.js";
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* This block queries the scene event coordinator's `pressedKeys` set,
|
|
9
|
-
* which is updated in real-time by the keyboard observers. It is designed
|
|
10
|
-
* to be polled every frame (e.g. from a Scene Tick event chain) but can
|
|
11
|
-
* also be read on demand from any execution context.
|
|
12
|
-
*
|
|
13
|
-
* The `key` input uses `KeyboardEvent.code` values (e.g. "KeyA", "Space",
|
|
14
|
-
* "ShiftLeft", "ControlLeft", "AltLeft", "MetaLeft" for Mac Cmd).
|
|
15
|
-
*
|
|
16
|
-
* Modifier inputs (`withShift`, `withCtrl`, `withAlt`, `withMeta`,
|
|
17
|
-
* `withCommandOrCtrl`) default to false. Set any to true to require that
|
|
18
|
-
* modifier to also be held for `isPressed` to be true.
|
|
19
|
-
* For example, key = "KeyA" + withCommandOrCtrl = true checks for
|
|
20
|
-
* Cmd+A on macOS or Ctrl+A on Windows/Linux.
|
|
2
|
+
* Re-exports pure implementation and applies runtime side effects.
|
|
3
|
+
* Import flowGraphIsKeyPressedBlock.pure for tree-shakeable, side-effect-free usage.
|
|
21
4
|
*/
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* @param config optional configuration
|
|
26
|
-
*/
|
|
27
|
-
constructor(config) {
|
|
28
|
-
super(config);
|
|
29
|
-
this.key = this.registerDataInput("key", RichTypeString);
|
|
30
|
-
this.withShift = this.registerDataInput("withShift", RichTypeBoolean);
|
|
31
|
-
this.withCtrl = this.registerDataInput("withCtrl", RichTypeBoolean);
|
|
32
|
-
this.withAlt = this.registerDataInput("withAlt", RichTypeBoolean);
|
|
33
|
-
this.withMeta = this.registerDataInput("withMeta", RichTypeBoolean);
|
|
34
|
-
this.withCommandOrCtrl = this.registerDataInput("withCommandOrCtrl", RichTypeBoolean);
|
|
35
|
-
this.isPressed = this.registerDataOutput("isPressed", RichTypeBoolean);
|
|
36
|
-
}
|
|
37
|
-
/** @internal */
|
|
38
|
-
_updateOutputs(context) {
|
|
39
|
-
const coordinator = context.configuration.sceneEventCoordinator;
|
|
40
|
-
if (!coordinator) {
|
|
41
|
-
this.isPressed.setValue(false, context);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
const keys = coordinator.pressedKeys;
|
|
45
|
-
const keyCode = this.key.getValue(context);
|
|
46
|
-
// Primary key must be held (unless empty, in which case only modifiers are checked)
|
|
47
|
-
let pressed = keyCode ? keys.has(keyCode) : true;
|
|
48
|
-
// Check required modifiers
|
|
49
|
-
if (pressed && this.withShift.getValue(context)) {
|
|
50
|
-
pressed = keys.has("ShiftLeft") || keys.has("ShiftRight");
|
|
51
|
-
}
|
|
52
|
-
if (pressed && this.withCtrl.getValue(context)) {
|
|
53
|
-
pressed = keys.has("ControlLeft") || keys.has("ControlRight");
|
|
54
|
-
}
|
|
55
|
-
if (pressed && this.withAlt.getValue(context)) {
|
|
56
|
-
pressed = keys.has("AltLeft") || keys.has("AltRight");
|
|
57
|
-
}
|
|
58
|
-
if (pressed && this.withMeta.getValue(context)) {
|
|
59
|
-
pressed = keys.has("MetaLeft") || keys.has("MetaRight");
|
|
60
|
-
}
|
|
61
|
-
if (pressed && this.withCommandOrCtrl.getValue(context)) {
|
|
62
|
-
pressed = keys.has("CommandOrControl");
|
|
63
|
-
}
|
|
64
|
-
this.isPressed.setValue(pressed, context);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* @returns class name of the block.
|
|
68
|
-
*/
|
|
69
|
-
getClassName() {
|
|
70
|
-
return "FlowGraphIsKeyPressedBlock" /* FlowGraphBlockNames.IsKeyPressed */;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
RegisterClass("FlowGraphIsKeyPressedBlock" /* FlowGraphBlockNames.IsKeyPressed */, FlowGraphIsKeyPressedBlock);
|
|
5
|
+
export * from "./flowGraphIsKeyPressedBlock.pure.js";
|
|
6
|
+
import { RegisterFlowGraphIsKeyPressedBlock } from "./flowGraphIsKeyPressedBlock.pure.js";
|
|
7
|
+
RegisterFlowGraphIsKeyPressedBlock();
|
|
74
8
|
//# sourceMappingURL=flowGraphIsKeyPressedBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphIsKeyPressedBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"flowGraphIsKeyPressedBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,mCAAmC,CAAC;AAElD,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,kCAAkC,EAAE,CAAC","sourcesContent":["/**\n * Re-exports pure implementation and applies runtime side effects.\n * Import flowGraphIsKeyPressedBlock.pure for tree-shakeable, side-effect-free usage.\n */\nexport * from \"./flowGraphIsKeyPressedBlock.pure\";\n\nimport { RegisterFlowGraphIsKeyPressedBlock } from \"./flowGraphIsKeyPressedBlock.pure\";\nRegisterFlowGraphIsKeyPressedBlock();\n"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { FlowGraphBlock, type IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
|
|
3
|
+
import { type FlowGraphContext } from "../../flowGraphContext.js";
|
|
4
|
+
import { type FlowGraphDataConnection } from "../../flowGraphDataConnection.pure.js";
|
|
5
|
+
/**
|
|
6
|
+
* A data block that outputs whether a specific keyboard key is currently pressed,
|
|
7
|
+
* optionally requiring one or more modifier keys to also be held.
|
|
8
|
+
*
|
|
9
|
+
* This block queries the scene event coordinator's `pressedKeys` set,
|
|
10
|
+
* which is updated in real-time by the keyboard observers. It is designed
|
|
11
|
+
* to be polled every frame (e.g. from a Scene Tick event chain) but can
|
|
12
|
+
* also be read on demand from any execution context.
|
|
13
|
+
*
|
|
14
|
+
* The `key` input uses `KeyboardEvent.code` values (e.g. "KeyA", "Space",
|
|
15
|
+
* "ShiftLeft", "ControlLeft", "AltLeft", "MetaLeft" for Mac Cmd).
|
|
16
|
+
*
|
|
17
|
+
* Modifier inputs (`withShift`, `withCtrl`, `withAlt`, `withMeta`,
|
|
18
|
+
* `withCommandOrCtrl`) default to false. Set any to true to require that
|
|
19
|
+
* modifier to also be held for `isPressed` to be true.
|
|
20
|
+
* For example, key = "KeyA" + withCommandOrCtrl = true checks for
|
|
21
|
+
* Cmd+A on macOS or Ctrl+A on Windows/Linux.
|
|
22
|
+
*/
|
|
23
|
+
export declare class FlowGraphIsKeyPressedBlock extends FlowGraphBlock {
|
|
24
|
+
/**
|
|
25
|
+
* Input connection: the `KeyboardEvent.code` of the key to check
|
|
26
|
+
* (e.g. "KeyA", "Space", "ShiftLeft").
|
|
27
|
+
*/
|
|
28
|
+
readonly key: FlowGraphDataConnection<string>;
|
|
29
|
+
/**
|
|
30
|
+
* Input connection: when true, Shift must also be held.
|
|
31
|
+
*/
|
|
32
|
+
readonly withShift: FlowGraphDataConnection<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* Input connection: when true, Ctrl must also be held.
|
|
35
|
+
*/
|
|
36
|
+
readonly withCtrl: FlowGraphDataConnection<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Input connection: when true, Alt (Option on macOS) must also be held.
|
|
39
|
+
*/
|
|
40
|
+
readonly withAlt: FlowGraphDataConnection<boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* Input connection: when true, Meta (Win key / Cmd) must also be held.
|
|
43
|
+
*/
|
|
44
|
+
readonly withMeta: FlowGraphDataConnection<boolean>;
|
|
45
|
+
/**
|
|
46
|
+
* Input connection: when true, the platform-appropriate "command" modifier
|
|
47
|
+
* must also be held (Cmd on macOS, Ctrl on Windows/Linux).
|
|
48
|
+
* This uses the virtual "CommandOrControl" key tracked by the coordinator.
|
|
49
|
+
*/
|
|
50
|
+
readonly withCommandOrCtrl: FlowGraphDataConnection<boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* Output connection: true if the key (and all required modifiers) are currently held down.
|
|
53
|
+
*/
|
|
54
|
+
readonly isPressed: FlowGraphDataConnection<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Creates a new FlowGraphIsKeyPressedBlock.
|
|
57
|
+
* @param config optional configuration
|
|
58
|
+
*/
|
|
59
|
+
constructor(config?: IFlowGraphBlockConfiguration);
|
|
60
|
+
/** @internal */
|
|
61
|
+
_updateOutputs(context: FlowGraphContext): void;
|
|
62
|
+
/**
|
|
63
|
+
* @returns class name of the block.
|
|
64
|
+
*/
|
|
65
|
+
getClassName(): string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Registers the FlowGraphIsKeyPressedBlock class.
|
|
69
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
70
|
+
*/
|
|
71
|
+
export declare function RegisterFlowGraphIsKeyPressedBlock(): void;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { FlowGraphBlock } from "../../flowGraphBlock.js";
|
|
3
|
+
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
4
|
+
import { RichTypeBoolean, RichTypeString } from "../../flowGraphRichTypes.pure.js";
|
|
5
|
+
/**
|
|
6
|
+
* A data block that outputs whether a specific keyboard key is currently pressed,
|
|
7
|
+
* optionally requiring one or more modifier keys to also be held.
|
|
8
|
+
*
|
|
9
|
+
* This block queries the scene event coordinator's `pressedKeys` set,
|
|
10
|
+
* which is updated in real-time by the keyboard observers. It is designed
|
|
11
|
+
* to be polled every frame (e.g. from a Scene Tick event chain) but can
|
|
12
|
+
* also be read on demand from any execution context.
|
|
13
|
+
*
|
|
14
|
+
* The `key` input uses `KeyboardEvent.code` values (e.g. "KeyA", "Space",
|
|
15
|
+
* "ShiftLeft", "ControlLeft", "AltLeft", "MetaLeft" for Mac Cmd).
|
|
16
|
+
*
|
|
17
|
+
* Modifier inputs (`withShift`, `withCtrl`, `withAlt`, `withMeta`,
|
|
18
|
+
* `withCommandOrCtrl`) default to false. Set any to true to require that
|
|
19
|
+
* modifier to also be held for `isPressed` to be true.
|
|
20
|
+
* For example, key = "KeyA" + withCommandOrCtrl = true checks for
|
|
21
|
+
* Cmd+A on macOS or Ctrl+A on Windows/Linux.
|
|
22
|
+
*/
|
|
23
|
+
export class FlowGraphIsKeyPressedBlock extends FlowGraphBlock {
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new FlowGraphIsKeyPressedBlock.
|
|
26
|
+
* @param config optional configuration
|
|
27
|
+
*/
|
|
28
|
+
constructor(config) {
|
|
29
|
+
super(config);
|
|
30
|
+
this.key = this.registerDataInput("key", RichTypeString);
|
|
31
|
+
this.withShift = this.registerDataInput("withShift", RichTypeBoolean);
|
|
32
|
+
this.withCtrl = this.registerDataInput("withCtrl", RichTypeBoolean);
|
|
33
|
+
this.withAlt = this.registerDataInput("withAlt", RichTypeBoolean);
|
|
34
|
+
this.withMeta = this.registerDataInput("withMeta", RichTypeBoolean);
|
|
35
|
+
this.withCommandOrCtrl = this.registerDataInput("withCommandOrCtrl", RichTypeBoolean);
|
|
36
|
+
this.isPressed = this.registerDataOutput("isPressed", RichTypeBoolean);
|
|
37
|
+
}
|
|
38
|
+
/** @internal */
|
|
39
|
+
_updateOutputs(context) {
|
|
40
|
+
const coordinator = context.configuration.sceneEventCoordinator;
|
|
41
|
+
if (!coordinator) {
|
|
42
|
+
this.isPressed.setValue(false, context);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const keys = coordinator.pressedKeys;
|
|
46
|
+
const keyCode = this.key.getValue(context);
|
|
47
|
+
// Primary key must be held (unless empty, in which case only modifiers are checked)
|
|
48
|
+
let pressed = keyCode ? keys.has(keyCode) : true;
|
|
49
|
+
// Check required modifiers
|
|
50
|
+
if (pressed && this.withShift.getValue(context)) {
|
|
51
|
+
pressed = keys.has("ShiftLeft") || keys.has("ShiftRight");
|
|
52
|
+
}
|
|
53
|
+
if (pressed && this.withCtrl.getValue(context)) {
|
|
54
|
+
pressed = keys.has("ControlLeft") || keys.has("ControlRight");
|
|
55
|
+
}
|
|
56
|
+
if (pressed && this.withAlt.getValue(context)) {
|
|
57
|
+
pressed = keys.has("AltLeft") || keys.has("AltRight");
|
|
58
|
+
}
|
|
59
|
+
if (pressed && this.withMeta.getValue(context)) {
|
|
60
|
+
pressed = keys.has("MetaLeft") || keys.has("MetaRight");
|
|
61
|
+
}
|
|
62
|
+
if (pressed && this.withCommandOrCtrl.getValue(context)) {
|
|
63
|
+
pressed = keys.has("CommandOrControl");
|
|
64
|
+
}
|
|
65
|
+
this.isPressed.setValue(pressed, context);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @returns class name of the block.
|
|
69
|
+
*/
|
|
70
|
+
getClassName() {
|
|
71
|
+
return "FlowGraphIsKeyPressedBlock" /* FlowGraphBlockNames.IsKeyPressed */;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
let _Registered = false;
|
|
75
|
+
/**
|
|
76
|
+
* Registers the FlowGraphIsKeyPressedBlock class.
|
|
77
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
78
|
+
*/
|
|
79
|
+
export function RegisterFlowGraphIsKeyPressedBlock() {
|
|
80
|
+
if (_Registered) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
_Registered = true;
|
|
84
|
+
RegisterClass("FlowGraphIsKeyPressedBlock" /* FlowGraphBlockNames.IsKeyPressed */, FlowGraphIsKeyPressedBlock);
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=flowGraphIsKeyPressedBlock.pure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowGraphIsKeyPressedBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,cAAc,EAAqC,MAAM,+BAA+B,CAAC;AAElG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAEzF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,0BAA2B,SAAQ,cAAc;IAuC1D;;;OAGG;IACH,YAAmB,MAAqC;QACpD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACtE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;QACpE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QAClE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;QACpE,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;QACtF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAC3E,CAAC;IAED,gBAAgB;IACA,cAAc,CAAC,OAAyB;QACpD,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAC;QAChE,IAAI,CAAC,WAAW,EAAE,CAAC;YACf,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YACxC,OAAO;QACX,CAAC;QACD,MAAM,IAAI,GAAG,WAAW,CAAC,WAAW,CAAC;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAE3C,oFAAoF;QACpF,IAAI,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAEjD,2BAA2B;QAC3B,IAAI,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9C,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC9D,CAAC;QACD,IAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7C,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAClE,CAAC;QACD,IAAI,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5C,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC1D,CAAC;QACD,IAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7C,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC5D,CAAC;QACD,IAAI,OAAO,IAAI,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACtD,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC3C,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,2EAAwC;IAC5C,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,kCAAkC;IAC9C,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,sEAAmC,0BAA0B,CAAC,CAAC;AAChF,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\n\nimport { FlowGraphBlock, type IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport { type FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport { type FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection.pure\";\nimport { RichTypeBoolean, RichTypeString } from \"core/FlowGraph/flowGraphRichTypes.pure\";\n\n/**\n * A data block that outputs whether a specific keyboard key is currently pressed,\n * optionally requiring one or more modifier keys to also be held.\n *\n * This block queries the scene event coordinator's `pressedKeys` set,\n * which is updated in real-time by the keyboard observers. It is designed\n * to be polled every frame (e.g. from a Scene Tick event chain) but can\n * also be read on demand from any execution context.\n *\n * The `key` input uses `KeyboardEvent.code` values (e.g. \"KeyA\", \"Space\",\n * \"ShiftLeft\", \"ControlLeft\", \"AltLeft\", \"MetaLeft\" for Mac Cmd).\n *\n * Modifier inputs (`withShift`, `withCtrl`, `withAlt`, `withMeta`,\n * `withCommandOrCtrl`) default to false. Set any to true to require that\n * modifier to also be held for `isPressed` to be true.\n * For example, key = \"KeyA\" + withCommandOrCtrl = true checks for\n * Cmd+A on macOS or Ctrl+A on Windows/Linux.\n */\nexport class FlowGraphIsKeyPressedBlock extends FlowGraphBlock {\n /**\n * Input connection: the `KeyboardEvent.code` of the key to check\n * (e.g. \"KeyA\", \"Space\", \"ShiftLeft\").\n */\n public readonly key: FlowGraphDataConnection<string>;\n\n /**\n * Input connection: when true, Shift must also be held.\n */\n public readonly withShift: FlowGraphDataConnection<boolean>;\n\n /**\n * Input connection: when true, Ctrl must also be held.\n */\n public readonly withCtrl: FlowGraphDataConnection<boolean>;\n\n /**\n * Input connection: when true, Alt (Option on macOS) must also be held.\n */\n public readonly withAlt: FlowGraphDataConnection<boolean>;\n\n /**\n * Input connection: when true, Meta (Win key / Cmd) must also be held.\n */\n public readonly withMeta: FlowGraphDataConnection<boolean>;\n\n /**\n * Input connection: when true, the platform-appropriate \"command\" modifier\n * must also be held (Cmd on macOS, Ctrl on Windows/Linux).\n * This uses the virtual \"CommandOrControl\" key tracked by the coordinator.\n */\n public readonly withCommandOrCtrl: FlowGraphDataConnection<boolean>;\n\n /**\n * Output connection: true if the key (and all required modifiers) are currently held down.\n */\n public readonly isPressed: FlowGraphDataConnection<boolean>;\n\n /**\n * Creates a new FlowGraphIsKeyPressedBlock.\n * @param config optional configuration\n */\n public constructor(config?: IFlowGraphBlockConfiguration) {\n super(config);\n this.key = this.registerDataInput(\"key\", RichTypeString);\n this.withShift = this.registerDataInput(\"withShift\", RichTypeBoolean);\n this.withCtrl = this.registerDataInput(\"withCtrl\", RichTypeBoolean);\n this.withAlt = this.registerDataInput(\"withAlt\", RichTypeBoolean);\n this.withMeta = this.registerDataInput(\"withMeta\", RichTypeBoolean);\n this.withCommandOrCtrl = this.registerDataInput(\"withCommandOrCtrl\", RichTypeBoolean);\n this.isPressed = this.registerDataOutput(\"isPressed\", RichTypeBoolean);\n }\n\n /** @internal */\n public override _updateOutputs(context: FlowGraphContext): void {\n const coordinator = context.configuration.sceneEventCoordinator;\n if (!coordinator) {\n this.isPressed.setValue(false, context);\n return;\n }\n const keys = coordinator.pressedKeys;\n const keyCode = this.key.getValue(context);\n\n // Primary key must be held (unless empty, in which case only modifiers are checked)\n let pressed = keyCode ? keys.has(keyCode) : true;\n\n // Check required modifiers\n if (pressed && this.withShift.getValue(context)) {\n pressed = keys.has(\"ShiftLeft\") || keys.has(\"ShiftRight\");\n }\n if (pressed && this.withCtrl.getValue(context)) {\n pressed = keys.has(\"ControlLeft\") || keys.has(\"ControlRight\");\n }\n if (pressed && this.withAlt.getValue(context)) {\n pressed = keys.has(\"AltLeft\") || keys.has(\"AltRight\");\n }\n if (pressed && this.withMeta.getValue(context)) {\n pressed = keys.has(\"MetaLeft\") || keys.has(\"MetaRight\");\n }\n if (pressed && this.withCommandOrCtrl.getValue(context)) {\n pressed = keys.has(\"CommandOrControl\");\n }\n\n this.isPressed.setValue(pressed, context);\n }\n\n /**\n * @returns class name of the block.\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.IsKeyPressed;\n }\n}\n\nlet _Registered = false;\n/**\n * Registers the FlowGraphIsKeyPressedBlock class.\n * Safe to call multiple times; only the first call has an effect.\n */\nexport function RegisterFlowGraphIsKeyPressedBlock(): void {\n if (_Registered) {\n return;\n }\n _Registered = true;\n\n RegisterClass(FlowGraphBlockNames.IsKeyPressed, FlowGraphIsKeyPressedBlock);\n}\n"]}
|
|
@@ -8,6 +8,7 @@ export * from "../Execution/flowGraphSetPropertyBlock.pure.js";
|
|
|
8
8
|
export * from "./flowGraphConstantBlock.pure.js";
|
|
9
9
|
export * from "./flowGraphGetAssetBlock.pure.js";
|
|
10
10
|
export * from "./flowGraphDataSwitchBlock.pure.js";
|
|
11
|
+
export * from "./flowGraphIsKeyPressedBlock.pure.js";
|
|
11
12
|
export * from "./Math/pure.js";
|
|
12
13
|
export * from "./Transformers/pure.js";
|
|
13
14
|
export * from "./Utils/pure.js";
|
|
@@ -9,6 +9,7 @@ export * from "../Execution/flowGraphSetPropertyBlock.pure.js";
|
|
|
9
9
|
export * from "./flowGraphConstantBlock.pure.js";
|
|
10
10
|
export * from "./flowGraphGetAssetBlock.pure.js";
|
|
11
11
|
export * from "./flowGraphDataSwitchBlock.pure.js";
|
|
12
|
+
export * from "./flowGraphIsKeyPressedBlock.pure.js";
|
|
12
13
|
export * from "./Math/pure.js";
|
|
13
14
|
export * from "./Transformers/pure.js";
|
|
14
15
|
export * from "./Utils/pure.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,oEAAoE;AACpE,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,kCAAkC,CAAC;AACjD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nexport * from \"./flowGraphConditionalDataBlock.pure\";\nexport * from \"./flowGraphGetVariableBlock.pure\";\nexport * from \"../Execution/flowGraphSetVariableBlock.pure\";\nexport * from \"./flowGraphTransformCoordinatesSystemBlock.pure\";\nexport * from \"./flowGraphGetPropertyBlock.pure\";\nexport * from \"../Execution/flowGraphSetPropertyBlock.pure\";\nexport * from \"./flowGraphConstantBlock.pure\";\nexport * from \"./flowGraphGetAssetBlock.pure\";\nexport * from \"./flowGraphDataSwitchBlock.pure\";\nexport * from \"./Math/pure\";\nexport * from \"./Transformers/pure\";\nexport * from \"./Utils/pure\";\nexport * from \"./Physics/pure\";\nexport * from \"./Audio/pure\";\nexport * from \"./flowGraphDebugBlock.pure\";\n"]}
|
|
1
|
+
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,oEAAoE;AACpE,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,kCAAkC,CAAC;AACjD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nexport * from \"./flowGraphConditionalDataBlock.pure\";\nexport * from \"./flowGraphGetVariableBlock.pure\";\nexport * from \"../Execution/flowGraphSetVariableBlock.pure\";\nexport * from \"./flowGraphTransformCoordinatesSystemBlock.pure\";\nexport * from \"./flowGraphGetPropertyBlock.pure\";\nexport * from \"../Execution/flowGraphSetPropertyBlock.pure\";\nexport * from \"./flowGraphConstantBlock.pure\";\nexport * from \"./flowGraphGetAssetBlock.pure\";\nexport * from \"./flowGraphDataSwitchBlock.pure\";\nexport * from \"./flowGraphIsKeyPressedBlock.pure\";\nexport * from \"./Math/pure\";\nexport * from \"./Transformers/pure\";\nexport * from \"./Utils/pure\";\nexport * from \"./Physics/pure\";\nexport * from \"./Audio/pure\";\nexport * from \"./flowGraphDebugBlock.pure\";\n"]}
|
|
@@ -1,39 +1,5 @@
|
|
|
1
|
-
import { type KeyboardInfo } from "../../../Events/keyboardEvents.js";
|
|
2
|
-
import { type FlowGraphContext } from "../../flowGraphContext.js";
|
|
3
|
-
import { type FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
|
|
4
|
-
import { FlowGraphEventType } from "../../flowGraphEventType.js";
|
|
5
|
-
import { FlowGraphKeyboardEventBlock, type IFlowGraphKeyboardEventBlockConfiguration } from "./flowGraphKeyboardEventBlock.js";
|
|
6
1
|
/**
|
|
7
|
-
*
|
|
2
|
+
* Re-exports pure implementation and applies runtime side effects.
|
|
3
|
+
* Import flowGraphKeyDownEventBlock.pure for tree-shakeable, side-effect-free usage.
|
|
8
4
|
*/
|
|
9
|
-
export
|
|
10
|
-
/**
|
|
11
|
-
* When true, auto-repeat key-down events (the user holding a key) are
|
|
12
|
-
* ignored and only the initial press fires the block. Defaults to false.
|
|
13
|
-
*/
|
|
14
|
-
ignoreRepeat?: boolean;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* A keyboard event block that fires when a key is pressed down.
|
|
18
|
-
* Extends {@link FlowGraphKeyboardEventBlock} with an `isRepeat` output
|
|
19
|
-
* and an `ignoreRepeat` configuration option.
|
|
20
|
-
*/
|
|
21
|
-
export declare class FlowGraphKeyDownEventBlock extends FlowGraphKeyboardEventBlock {
|
|
22
|
-
/**
|
|
23
|
-
* Output connection: whether this is an auto-repeat event (key held down).
|
|
24
|
-
*/
|
|
25
|
-
readonly isRepeat: FlowGraphDataConnection<boolean>;
|
|
26
|
-
/** @internal */
|
|
27
|
-
readonly type: FlowGraphEventType;
|
|
28
|
-
/**
|
|
29
|
-
* Creates a new FlowGraphKeyDownEventBlock.
|
|
30
|
-
* @param config optional configuration
|
|
31
|
-
*/
|
|
32
|
-
constructor(config?: IFlowGraphKeyDownEventBlockConfiguration);
|
|
33
|
-
/** @internal */
|
|
34
|
-
_executeEvent(context: FlowGraphContext, keyboardInfo: KeyboardInfo): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* @returns class name of the block.
|
|
37
|
-
*/
|
|
38
|
-
getClassName(): string;
|
|
39
|
-
}
|
|
5
|
+
export * from "./flowGraphKeyDownEventBlock.pure.js";
|
|
@@ -1,42 +1,8 @@
|
|
|
1
|
-
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
2
|
-
import { RichTypeBoolean } from "../../flowGraphRichTypes.js";
|
|
3
|
-
import { FlowGraphKeyboardEventBlock } from "./flowGraphKeyboardEventBlock.js";
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* and an `ignoreRepeat` configuration option.
|
|
2
|
+
* Re-exports pure implementation and applies runtime side effects.
|
|
3
|
+
* Import flowGraphKeyDownEventBlock.pure for tree-shakeable, side-effect-free usage.
|
|
8
4
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* @param config optional configuration
|
|
13
|
-
*/
|
|
14
|
-
constructor(config) {
|
|
15
|
-
super(config);
|
|
16
|
-
/** @internal */
|
|
17
|
-
this.type = "KeyDown" /* FlowGraphEventType.KeyDown */;
|
|
18
|
-
this.isRepeat = this.registerDataOutput("isRepeat", RichTypeBoolean);
|
|
19
|
-
}
|
|
20
|
-
/** @internal */
|
|
21
|
-
_executeEvent(context, keyboardInfo) {
|
|
22
|
-
const repeat = keyboardInfo.event.repeat ?? false;
|
|
23
|
-
// Skip auto-repeat events when configured to do so.
|
|
24
|
-
if (repeat && this.config?.ignoreRepeat) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
// Set the repeat output before delegating to the base class,
|
|
28
|
-
// which calls _execute() and fires signals — downstream blocks
|
|
29
|
-
// must see the correct value during that execution chain.
|
|
30
|
-
this.isRepeat.setValue(repeat, context);
|
|
31
|
-
// Delegate to the base class for key filtering, output population, and execution.
|
|
32
|
-
return super._executeEvent(context, keyboardInfo);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @returns class name of the block.
|
|
36
|
-
*/
|
|
37
|
-
getClassName() {
|
|
38
|
-
return "FlowGraphKeyDownEventBlock" /* FlowGraphBlockNames.KeyDownEvent */;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
RegisterClass("FlowGraphKeyDownEventBlock" /* FlowGraphBlockNames.KeyDownEvent */, FlowGraphKeyDownEventBlock);
|
|
5
|
+
export * from "./flowGraphKeyDownEventBlock.pure.js";
|
|
6
|
+
import { RegisterFlowGraphKeyDownEventBlock } from "./flowGraphKeyDownEventBlock.pure.js";
|
|
7
|
+
RegisterFlowGraphKeyDownEventBlock();
|
|
42
8
|
//# sourceMappingURL=flowGraphKeyDownEventBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphKeyDownEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flowGraphKeyDownEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,mCAAmC,CAAC;AAElD,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,kCAAkC,EAAE,CAAC","sourcesContent":["/**\n * Re-exports pure implementation and applies runtime side effects.\n * Import flowGraphKeyDownEventBlock.pure for tree-shakeable, side-effect-free usage.\n */\nexport * from \"./flowGraphKeyDownEventBlock.pure\";\n\nimport { RegisterFlowGraphKeyDownEventBlock } from \"./flowGraphKeyDownEventBlock.pure\";\nRegisterFlowGraphKeyDownEventBlock();\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { type KeyboardInfo } from "../../../Events/keyboardEvents.js";
|
|
3
|
+
import { type FlowGraphContext } from "../../flowGraphContext.js";
|
|
4
|
+
import { type FlowGraphDataConnection } from "../../flowGraphDataConnection.pure.js";
|
|
5
|
+
import { FlowGraphEventType } from "../../flowGraphEventType.js";
|
|
6
|
+
import { FlowGraphKeyboardEventBlock, type IFlowGraphKeyboardEventBlockConfiguration } from "./flowGraphKeyboardEventBlock.js";
|
|
7
|
+
/**
|
|
8
|
+
* Configuration for the key down event block.
|
|
9
|
+
*/
|
|
10
|
+
export interface IFlowGraphKeyDownEventBlockConfiguration extends IFlowGraphKeyboardEventBlockConfiguration {
|
|
11
|
+
/**
|
|
12
|
+
* When true, auto-repeat key-down events (the user holding a key) are
|
|
13
|
+
* ignored and only the initial press fires the block. Defaults to false.
|
|
14
|
+
*/
|
|
15
|
+
ignoreRepeat?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A keyboard event block that fires when a key is pressed down.
|
|
19
|
+
* Extends {@link FlowGraphKeyboardEventBlock} with an `isRepeat` output
|
|
20
|
+
* and an `ignoreRepeat` configuration option.
|
|
21
|
+
*/
|
|
22
|
+
export declare class FlowGraphKeyDownEventBlock extends FlowGraphKeyboardEventBlock {
|
|
23
|
+
/**
|
|
24
|
+
* Output connection: whether this is an auto-repeat event (key held down).
|
|
25
|
+
*/
|
|
26
|
+
readonly isRepeat: FlowGraphDataConnection<boolean>;
|
|
27
|
+
/** @internal */
|
|
28
|
+
readonly type: FlowGraphEventType;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a new FlowGraphKeyDownEventBlock.
|
|
31
|
+
* @param config optional configuration
|
|
32
|
+
*/
|
|
33
|
+
constructor(config?: IFlowGraphKeyDownEventBlockConfiguration);
|
|
34
|
+
/** @internal */
|
|
35
|
+
_executeEvent(context: FlowGraphContext, keyboardInfo: KeyboardInfo): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @returns class name of the block.
|
|
38
|
+
*/
|
|
39
|
+
getClassName(): string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Registers the FlowGraphKeyDownEventBlock class.
|
|
43
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
44
|
+
*/
|
|
45
|
+
export declare function RegisterFlowGraphKeyDownEventBlock(): void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
3
|
+
import { RichTypeBoolean } from "../../flowGraphRichTypes.pure.js";
|
|
4
|
+
import { FlowGraphKeyboardEventBlock } from "./flowGraphKeyboardEventBlock.js";
|
|
5
|
+
/**
|
|
6
|
+
* A keyboard event block that fires when a key is pressed down.
|
|
7
|
+
* Extends {@link FlowGraphKeyboardEventBlock} with an `isRepeat` output
|
|
8
|
+
* and an `ignoreRepeat` configuration option.
|
|
9
|
+
*/
|
|
10
|
+
export class FlowGraphKeyDownEventBlock extends FlowGraphKeyboardEventBlock {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new FlowGraphKeyDownEventBlock.
|
|
13
|
+
* @param config optional configuration
|
|
14
|
+
*/
|
|
15
|
+
constructor(config) {
|
|
16
|
+
super(config);
|
|
17
|
+
/** @internal */
|
|
18
|
+
this.type = "KeyDown" /* FlowGraphEventType.KeyDown */;
|
|
19
|
+
this.isRepeat = this.registerDataOutput("isRepeat", RichTypeBoolean);
|
|
20
|
+
}
|
|
21
|
+
/** @internal */
|
|
22
|
+
_executeEvent(context, keyboardInfo) {
|
|
23
|
+
const repeat = keyboardInfo.event.repeat ?? false;
|
|
24
|
+
// Skip auto-repeat events when configured to do so.
|
|
25
|
+
if (repeat && this.config?.ignoreRepeat) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
// Set the repeat output before delegating to the base class,
|
|
29
|
+
// which calls _execute() and fires signals — downstream blocks
|
|
30
|
+
// must see the correct value during that execution chain.
|
|
31
|
+
this.isRepeat.setValue(repeat, context);
|
|
32
|
+
// Delegate to the base class for key filtering, output population, and execution.
|
|
33
|
+
return super._executeEvent(context, keyboardInfo);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @returns class name of the block.
|
|
37
|
+
*/
|
|
38
|
+
getClassName() {
|
|
39
|
+
return "FlowGraphKeyDownEventBlock" /* FlowGraphBlockNames.KeyDownEvent */;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
let _Registered = false;
|
|
43
|
+
/**
|
|
44
|
+
* Registers the FlowGraphKeyDownEventBlock class.
|
|
45
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
46
|
+
*/
|
|
47
|
+
export function RegisterFlowGraphKeyDownEventBlock() {
|
|
48
|
+
if (_Registered) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
_Registered = true;
|
|
52
|
+
RegisterClass("FlowGraphKeyDownEventBlock" /* FlowGraphBlockNames.KeyDownEvent */, FlowGraphKeyDownEventBlock);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=flowGraphKeyDownEventBlock.pure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowGraphKeyDownEventBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAI7D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAEzE,OAAO,EAAE,2BAA2B,EAAkD,MAAM,+BAA+B,CAAC;AAa5H;;;;GAIG;AACH,MAAM,OAAO,0BAA2B,SAAQ,2BAA2B;IASvE;;;OAGG;IACH,YAAmB,MAAiD;QAChE,KAAK,CAAC,MAAM,CAAC,CAAC;QARlB,gBAAgB;QACS,SAAI,8CAAkD;QAQ3E,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IACzE,CAAC;IAED,gBAAgB;IACA,aAAa,CAAC,OAAyB,EAAE,YAA0B;QAC/E,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC;QAElD,oDAAoD;QACpD,IAAI,MAAM,IAAK,IAAI,CAAC,MAAmD,EAAE,YAAY,EAAE,CAAC;YACpF,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,6DAA6D;QAC7D,+DAA+D;QAC/D,0DAA0D;QAC1D,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAExC,kFAAkF;QAClF,OAAO,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,2EAAwC;IAC5C,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,kCAAkC;IAC9C,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,sEAAmC,0BAA0B,CAAC,CAAC;AAChF,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\n\nimport { type KeyboardInfo } from \"core/Events/keyboardEvents\";\nimport { type FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport { type FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection.pure\";\nimport { RichTypeBoolean } from \"core/FlowGraph/flowGraphRichTypes.pure\";\nimport { FlowGraphEventType } from \"core/FlowGraph/flowGraphEventType\";\nimport { FlowGraphKeyboardEventBlock, type IFlowGraphKeyboardEventBlockConfiguration } from \"./flowGraphKeyboardEventBlock\";\n\n/**\n * Configuration for the key down event block.\n */\nexport interface IFlowGraphKeyDownEventBlockConfiguration extends IFlowGraphKeyboardEventBlockConfiguration {\n /**\n * When true, auto-repeat key-down events (the user holding a key) are\n * ignored and only the initial press fires the block. Defaults to false.\n */\n ignoreRepeat?: boolean;\n}\n\n/**\n * A keyboard event block that fires when a key is pressed down.\n * Extends {@link FlowGraphKeyboardEventBlock} with an `isRepeat` output\n * and an `ignoreRepeat` configuration option.\n */\nexport class FlowGraphKeyDownEventBlock extends FlowGraphKeyboardEventBlock {\n /**\n * Output connection: whether this is an auto-repeat event (key held down).\n */\n public readonly isRepeat: FlowGraphDataConnection<boolean>;\n\n /** @internal */\n public override readonly type: FlowGraphEventType = FlowGraphEventType.KeyDown;\n\n /**\n * Creates a new FlowGraphKeyDownEventBlock.\n * @param config optional configuration\n */\n public constructor(config?: IFlowGraphKeyDownEventBlockConfiguration) {\n super(config);\n this.isRepeat = this.registerDataOutput(\"isRepeat\", RichTypeBoolean);\n }\n\n /** @internal */\n public override _executeEvent(context: FlowGraphContext, keyboardInfo: KeyboardInfo): boolean {\n const repeat = keyboardInfo.event.repeat ?? false;\n\n // Skip auto-repeat events when configured to do so.\n if (repeat && (this.config as IFlowGraphKeyDownEventBlockConfiguration)?.ignoreRepeat) {\n return true;\n }\n\n // Set the repeat output before delegating to the base class,\n // which calls _execute() and fires signals — downstream blocks\n // must see the correct value during that execution chain.\n this.isRepeat.setValue(repeat, context);\n\n // Delegate to the base class for key filtering, output population, and execution.\n return super._executeEvent(context, keyboardInfo);\n }\n\n /**\n * @returns class name of the block.\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.KeyDownEvent;\n }\n}\n\nlet _Registered = false;\n/**\n * Registers the FlowGraphKeyDownEventBlock class.\n * Safe to call multiple times; only the first call has an effect.\n */\nexport function RegisterFlowGraphKeyDownEventBlock(): void {\n if (_Registered) {\n return;\n }\n _Registered = true;\n\n RegisterClass(FlowGraphBlockNames.KeyDownEvent, FlowGraphKeyDownEventBlock);\n}\n"]}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
import { FlowGraphEventType } from "../../flowGraphEventType.js";
|
|
2
|
-
import { FlowGraphKeyboardEventBlock, type IFlowGraphKeyboardEventBlockConfiguration } from "./flowGraphKeyboardEventBlock.js";
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Re-exports pure implementation and applies runtime side effects.
|
|
3
|
+
* Import flowGraphKeyUpEventBlock.pure for tree-shakeable, side-effect-free usage.
|
|
6
4
|
*/
|
|
7
|
-
export
|
|
8
|
-
/** @internal */
|
|
9
|
-
readonly type: FlowGraphEventType;
|
|
10
|
-
/**
|
|
11
|
-
* Creates a new FlowGraphKeyUpEventBlock.
|
|
12
|
-
* @param config optional configuration
|
|
13
|
-
*/
|
|
14
|
-
constructor(config?: IFlowGraphKeyboardEventBlockConfiguration);
|
|
15
|
-
/**
|
|
16
|
-
* @returns class name of the block.
|
|
17
|
-
*/
|
|
18
|
-
getClassName(): string;
|
|
19
|
-
}
|
|
5
|
+
export * from "./flowGraphKeyUpEventBlock.pure.js";
|