USingleClickInputBehavior

[USingleClickInputBehavior](API\Runtime\InteractiveToolsFramework\BaseBehaviors\USingleClickInputBehavior) implements a standard "button-click"-style input behavior.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

InteractiveToolsFramework

Header

/Engine/Source/Runtime/Experimental/InteractiveToolsFramework/Public/BaseBehaviors/SingleClickBehavior.h

Include

#include "BaseBehaviors/SingleClickBehavior.h"

Syntax

class USingleClickInputBehavior : public UAnyButtonInputBehavior

Remarks

USingleClickInputBehavior implements a standard "button-click"-style input behavior. The state machine works as follows: 1) on input-device-button-press, hit-test the target. If hit, begin capture 2) on input-device-button-release, hit-test the target. If hit, call Target::OnClicked(). If not hit, ignore click.

The second hit-test is required to allow the click to be "cancelled" by moving away from the target. This is standard GUI behavior. You can disable this second hit test using the .HitTestOnRelease property. This is strongly discouraged.

The hit-test and on-clicked functions are provided by a IClickBehaviorTarget instance.

Variables

Name Description

Public variable

bool

 

HitTestOnRelease

Hit-test is repeated on release (standard behavior). If false,

Public variable

TFunction< bool...

 

ModifierCheckFunc

WantsCapture() will only return capture request if this function returns true (or is null)

Public variable

FInputBehaviorM...

 

Modifiers

The modifier set for this behavior

Protected variable

IClickBehaviorT...

 

Target

Click Target object

Constructors

Name Description

Public function

USingleClickInputBehavior()

Functions

Name Description

Protected function Virtual

void

 

Clicked

(
    const FInputDeviceState& Input,
    const FInputCaptureData& Data
)

Internal function that forwards click evens to Target::OnClicked, you can customize behavior here

Public function Virtual

void

 

Initialize

(
    IClickBehaviorTarget* Target
)

Initialize this behavior with the given Target

Overridden from UInputBehavior

Name Description

Public function Virtual

FInputCaptur...

 

BeginCapture

(
    const FInputDeviceState& InputStat...,
    EInputCaptureSide eSide
)

Called after WantsCapture() returns a capture request that was accepted

Public function Virtual

void

 

ForceEndCapture

(
    const FInputCaptureData& CaptureDa...
)

If this is called, the Behavior has forcibly lost capture (eg due to app losing focus for example) and needs to clean up accordingly

Public function Virtual

FInputCaptur...

 

UpdateCapture

(
    const FInputDeviceState& InputStat...,
    const FInputCaptureData& CaptureDa...
)

Called for each new input event during a capture sequence.

Public function Virtual

FInputCaptur...

 

WantsCapture

(
    const FInputDeviceState& InputStat...
)

Given the input state, does this Behavior want to begin capturing some input devices?

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss