|
ManualInputEventsManager Class |
ManualInputEventsManager class simplifies working with pointer and mouse events on 3D objects.
Because this class is cross-platform, it cannot subscribe to platform specific events. This is done in special InputEventsManager classes that are implemented for WPF, Avalonia, WinUI and WinForms.
The following events can be subscribed on 3D objects: PointerPressed, PointerReleased, PointerClicked, PointerDoubleClicked, PointerWheelChanged, PointerEntered, PointerExited, PointerMoved, BeginPointerDrag, PointerDrag and EndPointerDrag events.
To register for those events, create an instance
ModelNodeEventsSource,
NamedModelNodesEventsSource,
NamedModelNodesEventsSource or created your own class that is derived from
InputEventsSource.
ManualInputEventsManager also provides a generic PointerEntered, PointerExited, PointerPressed, PointerReleased and PointerMoved events that can be used to be notified when a button is pressed or released over the SceneView or when pointer or mouse is moved.
Inheritance Hierarchy Namespace: Ab4d.SharpEngine.UtilitiesAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax public class ManualInputEventsManager
The ManualInputEventsManager type exposes the following members.
Constructors Properties | Name | Description |
---|
| DoubleClickTimeout |
Gets or sets a time in milliseconds from the first click to the second click to be considered as double click. Default value is 300 ms.
|
| DragPointerButtons |
Gets or sets buttons that are used for dragging. Default value is Left.
|
| DragPointerDistance |
Gets or sets the distance pointer must make when the move is considered as a drag. The default value is 5.
|
| IsDragging |
True when a ModelNode is currently being dragged.
|
| IsEnabled |
Gets or sets a boolean value that specifies if the EventManager3D is enabled.
|
| SceneView |
Gets the SceneView that contains the SceneNode objects that are used by this ManualInputEventsManager.
|
| TriggerEnterLeaveEventsOnEachSceneNodeChange |
Gets or sets a Boolean that specifies if Enter and Leave events are triggered on each change of the SceneNode (when true).
When false, then Enter and Leave events are triggered only when InputEventSource object is changed
(for example, when using MultiModelNodesEventsSource then Leave and Enter events will not be triggered when pointer is moved from one to another SceneNode that are all registered by the same MultiModelNodesEventsSource).
Default value is true.
|
TopMethods | Name | Description |
---|
| CapturePointer |
CaptureMouse method captures the pointer or mouse events so that even if mouse is moved out of the active window, the mouse events are passed to the active window.
This method must be overriden by a derived class to provide any functionality.
To end the capture, call the EndPointerCapture method.
|
| EndPointerCapture |
EndPointerCapture end the pointer or mouse capture that was started by calling the CapturePointer method.
This method must be overriden by a derived class to provide any functionality.
|
| OnEventSourceMouseWheel |
OnEventSourceMouseWheel
|
| OnEventSourcePointerBeginDrag |
OnEventSourcePointerBeginDrag
|
| OnEventSourcePointerClick |
OnEventSourcePointerClick
|
| OnEventSourcePointerDoubleClick |
OnEventSourcePointerDoubleClick
|
| OnEventSourcePointerDown |
OnEventSourcePointerDown
|
| OnEventSourcePointerEndDrag |
OnEventSourcePointerEndDrag
|
| OnEventSourcePointerEnter |
OnEventSourcePointerEnter
|
| OnEventSourcePointerLeave |
OnEventSourcePointerLeave
|
| OnEventSourcePointerMove |
OnEventSourcePointerMove
|
| OnEventSourcePointerUp |
OnEventSourcePointerUp
|
| OnPointerEntered |
OnPointerEntered
|
| OnPointerExited |
OnPointerExited
|
| OnPointerMoved |
OnPointerMoved
|
| OnPointerPressed |
OnPointerPressed
|
| OnPointerReleased |
OnPointerReleased
|
| ProcessPointerEntered |
ProcessPointerEntered method processes the pointer enter event.
|
| ProcessPointerExited |
ProcessPointerExited method processes the pointer exited event.
|
| ProcessPointerMoved |
ProcessPointerMoved method processes the pointer move event and returns true if the event is handled by this method.
|
| ProcessPointerPositionChanged |
ProcessPointerPositionChanged is used to handle pointer move.
|
| ProcessPointerPressed |
ProcessPointerPressed method processes the button pressed event and returns true if the event is handled by this method.
|
| ProcessPointerReleased |
ProcessMouseReleased method processes the pointer released event and returns true if the event is handled by this method.
|
| ProcessPointerWheelChanged |
PointerWheelChanged method processes the pointer wheel event and returns true if the event is handled by this method.
|
| RegisterDragSurface(IListModelNode) |
Registers the ModelNodes in the specified list to be used as drag surface so that BeginPointerDrag, PointerDrag and EndPointerDrag events can be subscribed on event source objects.
|
| RegisterDragSurface(ModelNode) |
Registers the specified dragSurfaceModelNode to be used as drag surface so that BeginPointerDrag, PointerDrag and EndPointerDrag events can be subscribed on event source objects.
|
| RegisterDragSurface(ModelNode) |
Registers the specified ModelNode objects to be used as drag surface so that BeginPointerDrag, PointerDrag and EndPointerDrag events can be subscribed on event source objects.
|
| RegisterDragSurface(Vector3, Vector3) |
Registers a plane as a drag surface.
The method returns an index of the registered plane that can be used to remove the plane by calling RemoveDragSurface(Int32).
|
| RegisterEventsSource |
Registers the eventsSource to this ManualInputEventsManager
|
| RegisterExcludedSceneNode |
Registers a SceneNode that will be excluded from hit testing.
If sceneNode is a GroupNode, then all child SceneNodes are also excluded.
|
| RegisterExcludedSceneNodes(IListSceneNode) |
Registers a list of SceneNode objects that will be excluded from hit testing.
If SceneNode is a GroupNode, then all child SceneNodes are also excluded.
|
| RegisterExcludedSceneNodes(SceneNode) |
Registers a list of SceneNode objects that will be excluded from hit testing.
If SceneNode is a GroupNode, then all child SceneNodes are also excluded.
|
| RemoveAllDragSurfaces |
Removes all registered drag surfaces.
|
| RemoveDragSurface(IListModelNode) |
Removes the specified ModelNodes in the specified list as the drag surface.
|
| RemoveDragSurface(Int32) |
Removes the drag plane that was registered by calling RegisterDragSurface(Vector3, Vector3) (the dragSurfacePlaneIndex was returned by that method).
|
| RemoveDragSurface(ModelNode) |
Removes the specified ModelNode as the drag surface.
|
| RemoveDragSurface(ModelNode) |
Removes the specified ModelNode objects as the drag surface.
|
| RemoveEventsSource |
Removes the eventsSource from the ManualInputEventsManager
|
| RemoveExcludedSceneNode |
Removed the sceneNode from the excluded visuals list. To remove all excluded visuals it is also possible to call ResetEventSources method.
|
| RemoveExcludedSceneNodes |
Removed the sceneNodes from the excluded visuals list. To remove all excluded visuals it is also possible to call ResetEventSources method.
|
| ResetEventSources |
Clears all the registered EventsSource objects.
|
| UpdateHitObjects |
UpdateHitObjects method can be called to manually update the 3D objects that are behind the current mouse position.
This is useful when the camera is changed without moving the mouse.
In this case the 3D objects behind the mouse position can change.
If this happens the MouseEnter, MouseLeave and other event handlers will be called from the UpdateHitObjects method.
|
| UpdateLastHitObject |
UpdateLastHitObject method sets protected lastHitEventSource, lastHitSceneNode and lastRayHitResult with the hit event source data.
|
TopEvents | Name | Description |
---|
| PointerEntered |
PointerEntered is triggered when the pointer or mouse entered the SceneView.
|
| PointerExited |
PointerExited is triggered when the pointer or mouse left the SceneView.
|
| PointerMoved |
PointerMoved is triggered when the pointer or mouse was moved.
|
| PointerPressed |
PointerPressed is triggered when the pointer or mouse button was pressed.
|
| PointerReleased |
PointerReleased is triggered when the pointer or mouse button was released.
|
TopFields Remarks
ManualInputEventsManager class simplifies working with pointer and mouse events on 3D objects.
Because this class is cross-platform, it cannot subscribe to platform specific events. This is done in special InputEventsManager classes that are implemented for WPF, Avalonia, WinUI and WinForms.
The following events can be subscribed on 3D objects: PointerPressed, PointerReleased, PointerClicked, PointerDoubleClicked, PointerWheelChanged, PointerEntered, PointerExited, PointerMoved, BeginPointerDrag, PointerDrag and EndPointerDrag events.
To register for those events, create an instance ModelNodeEventsSource, NamedModelNodesEventsSource, NamedModelNodesEventsSource or created your own class that is derived from InputEventsSource.
ManualInputEventsManager also provides a generic PointerEntered, PointerExited, PointerPressed, PointerReleased and PointerMoved events that can be used to be notified when a button is pressed or released over the SceneView or when pointer or mouse is moved.
See Also