FCommonAnalogCursor

Analog cursor preprocessor that tastefully hijacks things a bit to support controller navigation by moving a hidden cursor around based on focus.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

CommonUI

Header

/Engine/Plugins/Experimental/CommonUI/Source/CommonUI/Public/Input/CommonAnalogCursor.h

Include

#include "Input/CommonAnalogCursor.h"

Syntax

class FCommonAnalogCursor : public FAnalogCursor

Remarks

Analog cursor preprocessor that tastefully hijacks things a bit to support controller navigation by moving a hidden cursor around based on focus.

Introduces a separate focus-driven mode of operation, wherein the cursor is made invisible and automatically updated to be centered over whatever widget is currently focused (except the game viewport - we completely hide it then)

Constructors

Name Description

Protected function

FCommonAnalogCursor

(
    const UCommonUIActionRouterBase& I...
)

Functions

Name Description

Public function Const

bool

 

CanReleaseMouseCapture()

Protected function Const

FVector2D

 

ClampPositionToViewport

(
    const FVector2D& InPosition
)

Public function Static

TSharedRef< ...

 

CreateAnalogCursor

(
    const UCommonUIActionRouterBase& I...
)

Protected function Virtual Const

EOrientation

 

DetermineScrollOrientation

(
    const UWidget& Widget
)

Protected function Const

UGameViewpor...

 

GetViewportClient()

Protected function

void

 

HideCursor()

Protected function Virtual

void

 

Initialize()

Protected function Const

bool

 

IsGameViewportInFocusPathWithoutCapture()

A ridiculous function name, but we have this exact question in a few places.

Protected function Const

bool

 

IsInViewport

(
    const FVector2D& Position
)

Public function

void

 

SetCursorMovementStick

(
    EAnalogStick InCursorMovementStick
)

Protected function

void

 

SetNormalizedCursorPosition

(
    const FVector2D& RelativeNewPositi...
)

Public function Virtual

void

 

ShouldHandleRightAnalog

(
    bool bInShouldHandleRightAnalog
)

Overridden from FAnalogCursor

Name Description

Public function Virtual Const

int32

 

GetOwnerUserIndex()

Protected function Virtual Const

bool

 

IsRelevantInput

(
    const FKeyEvent& KeyEvent
)

Protected function Virtual Const

bool

 

IsRelevantInput

(
    const FAnalogInputEvent& AnalogInp...
)

Overridden from IInputProcessor

Name Description

Public function Virtual

bool

 

HandleAnalogInputEvent

(
    FSlateApplication& SlateApp,
    const FAnalogInputEvent& InAnalogI...
)

Analog axis input

Public function Virtual

bool

 

HandleKeyDownEvent

(
    FSlateApplication& SlateApp,
    const FKeyEvent& InKeyEvent
)

Key down input

Public function Virtual

bool

 

HandleKeyUpEvent

(
    FSlateApplication& SlateApp,
    const FKeyEvent& InKeyEvent
)

Key up input

Public function Virtual

bool

 

HandleMouseButtonDownEvent

(
    FSlateApplication& SlateApp,
    const FPointerEvent& MouseEvent
)

Mouse button press

Public function Virtual

bool

 

HandleMouseButtonUpEvent

(
    FSlateApplication& SlateApp,
    const FPointerEvent& MouseEvent
)

Mouse button release

Public function Virtual

void

 

Tick

(
    const float DeltaTime,
    FSlateApplication& SlateApp,
    TSharedRef< ICursor > Cursor
)

Enums

Name

Description

Private enum

EShoulderButtonFlags

We'll also need a CommonNavigationConfig that respects the stick assignment as well so it also maps to nav mode EAnalogStick CursorMovementStick = EAnalogStick::Left;

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