Navigation
API > API/Plugins > API/Plugins/AvalancheInteractiveTools
UAvaSingleClickAndDragInputBehavior implements a combination of "button-click" and "button-click-drag"-style input behavior. If the mouse is moved away from the original location, and update will occur and a drag operation will start. If the mouse is released without moving too far away, a click event will occur. Once the drag has started, returning to the original location will not produce a click event will not be produced, but the drag operation will continue.
An IAvaSingleClickAndDragBehaviorTarget instance must be provided which is manipulated by this behavior.
The state machine works as follows: 1) on input-device-button-press, call Target::CanBeginSingleClickDragSequence to determine if capture should begin 2) on input-device-move, call Target::OnClickDrag if drag mode has been started or Target::OnDragStart if it crosses that threshold. 3) on input-device-button-release, call Target::OnClickRelease
If a ForceEndCapture occurs we call Target::OnTerminateDragClickSequence
| Name | UAvaSingleClickAndDragBehavior |
| Type | class |
| Header File | /Engine/Plugins/VirtualProduction/Avalanche/Source/AvalancheInteractiveTools/Public/Behaviors/AvaSingleClickAndDragBehavior.h |
| Include Path | #include "Behaviors/AvaSingleClickAndDragBehavior.h" |
Syntax
UCLASS ()
class UAvaSingleClickAndDragBehavior : public UAnyButtonInputBehavior
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UInputBehavior → UAnyButtonInputBehavior → UAvaSingleClickAndDragBehavior
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UAvaSingleClickAndDragBehavior() |
Behaviors/AvaSingleClickAndDragBehavior.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bDistanceTestClick | bool | If drag is not supported, then check distance when releasing the button. | Behaviors/AvaSingleClickAndDragBehavior.h | |
| bSupportsDrag | bool | If false, will never change into a drag event. | Behaviors/AvaSingleClickAndDragBehavior.h | |
| bUpdateModifiersDuringDrag | bool | If true, then we will update Modifier states in UpdateCapture(). | Behaviors/AvaSingleClickAndDragBehavior.h | |
| DragStartDistance | float | The distance the mouse has to travel to trigger a drag. | Behaviors/AvaSingleClickAndDragBehavior.h | |
| ModifierCheckFunc | TFunction< bool(const FInputDeviceState &)> | WantsCapture() will only return capture request if this function returns true (or is null) | Behaviors/AvaSingleClickAndDragBehavior.h | |
| Modifiers | FInputBehaviorModifierStates | The modifier set for this behavior | Behaviors/AvaSingleClickAndDragBehavior.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FInputCaptureUpdate BeginCapture
(
const FInputDeviceState& InInput, |
Behaviors/AvaSingleClickAndDragBehavior.h | ||
virtual void ForceEndCapture
(
const FInputCaptureData& InData |
Behaviors/AvaSingleClickAndDragBehavior.h | ||
const FInputDeviceRay & GetInitialMouseDownRay() |
Behaviors/AvaSingleClickAndDragBehavior.h | ||
virtual void Initialize
(
IAvaSingleClickAndDragBehaviorTarget* InTarget |
Initialize this behavior with the given Target | Behaviors/AvaSingleClickAndDragBehavior.h | |
virtual FInputCaptureUpdate UpdateCapture
(
const FInputDeviceState& InInput, |
Behaviors/AvaSingleClickAndDragBehavior.h | ||
virtual FInputCaptureRequest WantsCapture
(
const FInputDeviceState& InInput |
Behaviors/AvaSingleClickAndDragBehavior.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void OnClickDragInternal
(
const FInputDeviceState& InInput, |
Internal function that forwards click evens to Target::OnClickDrag, you can customize behavior here | Behaviors/AvaSingleClickAndDragBehavior.h | |
virtual void OnClickPressInternal
(
const FInputDeviceState& InInput, |
Internal function that forwards click evens to Target::OnClickPress, you can customize behavior here | Behaviors/AvaSingleClickAndDragBehavior.h | |
virtual void OnClickReleaseInternal
(
const FInputDeviceState& InInput, |
Internal function that forwards click evens to Target::OnClickRelease, you can customize behavior here | Behaviors/AvaSingleClickAndDragBehavior.h | |
virtual void OnDragStartedInternal
(
const FInputDeviceState& InInput, |
Internal function that forwards click evens to Target::OnDragStarted, you can customize behavior here | Behaviors/AvaSingleClickAndDragBehavior.h |