UInputRouter

[UInputRouter](API\Runtime\InteractiveToolsFramework\UInputRouter) mediates between a higher-level input event source (eg like an [FEdMode](API\Editor\UnrealEd\FEdMode)) and a set of InputBehaviors that respond to those events.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

InteractiveToolsFramework

Header

/Engine/Source/Runtime/Experimental/InteractiveToolsFramework/Public/InputRouter.h

Include

#include "InputRouter.h"

Syntax

class UInputRouter : public UObject

Remarks

UInputRouter mediates between a higher-level input event source (eg like an FEdMode) and a set of InputBehaviors that respond to those events. Sets of InputBehaviors are registered, and then PostInputEvent() is called for each event.

Internally one of the active Behaviors may "capture" the event stream. Separate "Left" and "Right" captures are supported, which means that (eg) an independent capture can be tracked for each VR controller.

If the input device supports "hover", PostHoverInputEvent() will forward hover events to InputBehaviors that also support it.

Variables

Name Description

Protected variable

UInputBehaviorS...

 

ActiveInputBehaviors

Protected variable

UInputBehavior ...

 

ActiveKeyboardCapture

Protected variable

FInputCaptureDa...

 

ActiveKeyboardCaptureData

Protected variable

void *

 

ActiveKeyboardCaptureOwner

Protected variable

UInputBehavior ...

 

ActiveLeftCapture

Protected variable

FInputCaptureDa...

 

ActiveLeftCaptureData

Protected variable

void *

 

ActiveLeftCaptureOwner

Protected variable

UInputBehavior ...

 

ActiveLeftHoverCapture

Hover support

Protected variable

void *

 

ActiveLeftHoverCaptureOwner

Protected variable

UInputBehavior ...

 

ActiveRightCapture

Protected variable

FInputCaptureDa...

 

ActiveRightCaptureData

Protected variable

void *

 

ActiveRightCaptureOwner

Public variable

bool

 

bAutoInvalidateOnCapture

If true, then we post an Invalidation (ie redraw) request on every captured input event (default false)

Public variable

bool

 

bAutoInvalidateOnHover

If true, then we post an Invalidation (ie redraw) request if any active InputBehavior responds to Hover events (default false)

Protected variable

IToolsContextTr...

 

TransactionsAPI

Constructors

Name Description

Protected function

UInputRouter()

Functions

Name Description

Protected function

void

 

CheckForKeyboardCaptures

(
    const FInputDeviceState& Input
)

Protected function

void

 

CheckForMouseCaptures

(
    const FInputDeviceState& Input
)

Public function Virtual

void

 

DeregisterSource

(
    IInputBehaviorSource* Source
)

Remove Behaviors from this Source from the active set

Public function Virtual

void

 

ForceTerminateAll()

Terminate any active captures and end all hovers

Public function Virtual

void

 

ForceTerminateSource

(
    IInputBehaviorSource* Source
)

If this Behavior is capturing, call ForceEndCapture() to notify that we are taking capture away

Protected function

void

 

HandleCapturedKeyboardInput

(
    const FInputDeviceState& Input
)

Protected function

void

 

HandleCapturedMouseInput

(
    const FInputDeviceState& Input
)

Public function Virtual Const

bool

 

HasActiveMouseCapture()

Returns true if there is an active mouse capture

Protected function Virtual

void

 

Initialize

Initialize the InputRouter with the necessary Context-level state.

Public function Virtual

void

 

PostHoverInputEvent

(
    const FInputDeviceState& Input
)

Insert a new hover input event which is forwarded to all hover-enabled Behaviors

Public function Virtual

void

 

PostInputEvent

(
    const FInputDeviceState& Input
)

Insert a new input event which is used to check for new captures, or forwarded to active capture

Protected function Virtual

void

 

PostInputEvent_Keyboard

(
    const FInputDeviceState& Input
)

Protected function Virtual

void

 

PostInputEvent_Mouse

(
    const FInputDeviceState& Input
)

Protected function

bool

 

ProcessMouseHover

(
    const FInputDeviceState& Input
)

Public function Virtual

void

 

RegisterBehavior

(
    UInputBehavior* Behavior,
    void* Source,
    const FString& GroupName
)

Add a new InputBehavior to the active behavior set, with optional Source and GroupName

Public function Virtual

void

 

RegisterSource

(
    IInputBehaviorSource* Source
)

Add a new behavior Source. Behaviors from this source will be added to the active behavior set.

Protected function Virtual

void

 

Shutdown()

Shutdown the InputRouter.

Protected function

void

 

TerminateHover

(
    EInputCaptureSide Side
)

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