Navigation
API > API/Runtime > API/Runtime/InteractiveToolsFramework
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.
| Name | USingleClickInputBehavior |
| Type | class |
| Header File | /Engine/Source/Runtime/InteractiveToolsFramework/Public/BaseBehaviors/SingleClickBehavior.h |
| Include Path | #include "BaseBehaviors/SingleClickBehavior.h" |
Syntax
UCLASS (MinimalAPI)
class USingleClickInputBehavior : public UAnyButtonInputBehavior
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UInputBehavior → UAnyButtonInputBehavior → USingleClickInputBehavior
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
USingleClickInputBehavior() |
BaseBehaviors/SingleClickBehavior.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| HitTestOnRelease | bool | Hit-test is repeated on release (standard behavior). If false, | BaseBehaviors/SingleClickBehavior.h | |
| ModifierCheckFunc | TFunction< bool(const FInputDeviceState &)> | WantsCapture() will only return capture request if this function returns true (or is null) | BaseBehaviors/SingleClickBehavior.h | |
| Modifiers | FInputBehaviorModifierStates | The modifier set for this behavior | BaseBehaviors/SingleClickBehavior.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Initialize
(
IClickBehaviorTarget* Target |
Initialize this behavior with the given Target | BaseBehaviors/SingleClickBehavior.h |
Overridden from UInputBehavior
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FInputCaptureUpdate BeginCapture
(
const FInputDeviceState& InputState, |
Called after WantsCapture() returns a capture request that was accepted | BaseBehaviors/SingleClickBehavior.h | |
virtual void ForceEndCapture
(
const FInputCaptureData& CaptureData |
If this is called, the Behavior has forcibly lost capture (eg due to app losing focus for example) and needs to clean up accordingly | BaseBehaviors/SingleClickBehavior.h | |
virtual FInputCaptureUpdate UpdateCapture
(
const FInputDeviceState& InputState, |
Called for each new input event during a capture sequence. | BaseBehaviors/SingleClickBehavior.h | |
virtual FInputCaptureRequest WantsCapture
(
const FInputDeviceState& InputState |
Given the input state, does this Behavior want to begin capturing some input devices? | BaseBehaviors/SingleClickBehavior.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Clicked
(
const FInputDeviceState& Input, |
Internal function that forwards click evens to Target::OnClicked, you can customize behavior here | BaseBehaviors/SingleClickBehavior.h |