Navigation
API > API/Plugins > API/Plugins/AvalancheInteractiveTools > API/Plugins/AvalancheInteractiveTools/Behaviors
Inheritance Hierarchy
- UObject
- UInputBehavior
- UAnyButtonInputBehavior
- UAvaSingleClickAndDragBehavior
References
| Module | AvalancheInteractiveTools |
| Header | /Engine/Plugins/Experimental/Avalanche/Source/AvalancheInteractiveTools/Public/Behaviors/AvaSingleClickAndDragBehavior.h |
| Include | #include "Behaviors/AvaSingleClickAndDragBehavior.h" |
Syntax
UCLASS ()
class UAvaSingleClickAndDragBehavior : public UAnyButtonInputBehavior
Remarks
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
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bDistanceTestClick | If drag is not supported, then check distance when releasing the button. | |
| bool | bInClickDrag | Set to true if we are in a capture | |
| bool | bIsDragOperation | Set to true if this is a drag operation. | |
| bool | bSupportsDrag | If false, will never change into a drag event. | |
| bool | bUpdateModifiersDuringDrag | If true, then we will update Modifier states in UpdateCapture(). | |
| float | DragStartDistance | The distance the mouse has to travel to trigger a drag. | |
| FInputDeviceRay | InitialMouseDownRay | The initial mouse down position. | |
| TFunction< bool(const FInputDeviceState &)> | ModifierCheckFunc | WantsCapture() will only return capture request if this function returns true (or is null) | |
| FInputBehaviorModifierStates | Modifiers | The modifier set for this behavior | |
| IAvaSingleClickAndDragBehaviorTarget * | Target | Click Target object |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| const FInputDeviceRay & | |||
| void | Initialize
(
IAvaSingleClickAndDragBehaviorTarget* InTarget |
Initialize this behavior with the given Target | |
| void | OnClickDragInternal
(
const FInputDeviceState& InInput, |
Internal function that forwards click evens to Target::OnClickDrag, you can customize behavior here | |
| void | OnClickPressInternal
(
const FInputDeviceState& InInput, |
Internal function that forwards click evens to Target::OnClickPress, you can customize behavior here | |
| void | OnClickReleaseInternal
(
const FInputDeviceState& InInput, |
Internal function that forwards click evens to Target::OnClickRelease, you can customize behavior here | |
| void | OnDragStartedInternal
(
const FInputDeviceState& InInput, |
Internal function that forwards click evens to Target::OnDragStarted, you can customize behavior here |
Overridden from UInputBehavior
| Type | Name | Description | |
|---|---|---|---|
| FInputCaptureUpdate | BeginCapture
(
const FInputDeviceState& InInput, |
Called after WantsCapture() returns a capture request that was accepted | |
| void | ForceEndCapture
(
const FInputCaptureData& InData |
If this is called, the Behavior has forcibly lost capture (eg due to app losing focus for example) and needs to clean up accordingly | |
| FInputCaptureUpdate | UpdateCapture
(
const FInputDeviceState& InInput, |
Called for each new input event during a capture sequence. | |
| FInputCaptureRequest | WantsCapture
(
const FInputDeviceState& InInput |
Given the input state, does this Behavior want to begin capturing some input devices? |