FPointerEvent

[FPointerEvent](API\Runtime\SlateCore\Input\FPointerEvent) describes a mouse or touch action (e.g. Press, Release, Move, etc).

Windows
MacOS
Linux

Inheritance Hierarchy

FInputEvent

FPointerEvent

FDragDropEvent

References

Module

SlateCore

Header

/Engine/Source/Runtime/SlateCore/Public/Input/Events.h

Include

#include "Input/Events.h"

Syntax

struct FPointerEvent : public FInputEvent

Remarks

FPointerEvent describes a mouse or touch action (e.g. Press, Release, Move, etc). It is passed to event handlers dealing with pointer-based input.

Constructors

Name Description

Public function

FPointerEvent()

UStruct Constructor. Not meant for normal usage.

Public function

FPointerEvent

(
    uint32 InPointerIndex,
    const FVector2D& InScreenSpacePosi...,
    const FVector2D& InLastScreenSpace...,
    const FVector2D& InDelta,
    const TSet< FKey >& InPressedButto...,
    const FModifierKeysState& InModifi...
)

A constructor for raw mouse events

Public function

FPointerEvent

(
    uint32 InPointerIndex,
    const FVector2D& InScreenSpacePosi...,
    const FVector2D& InLastScreenSpace...,
    const TSet< FKey >& InPressedButto...,
    FKey InEffectingButton,
    float InWheelDelta,
    const FModifierKeysState& InModifi...
)

Events are immutable once constructed.

Public function

FPointerEvent

(
    uint32 InUserIndex,
    uint32 InPointerIndex,
    const FVector2D& InScreenSpacePosi...,
    const FVector2D& InLastScreenSpace...,
    const FVector2D& InDelta,
    const TSet< FKey >& InPressedButto...,
    const FModifierKeysState& InModifi...
)

Public function

FPointerEvent

(
    uint32 InUserIndex,
    uint32 InPointerIndex,
    const FVector2D& InScreenSpacePosi...,
    const FVector2D& InLastScreenSpace...,
    bool bPressLeftMouseButton,
    const FModifierKeysState& InModifi...,
    uint32 InTouchpadIndex
)

FPointerEvent constructor now takes a Force parameter

Public function

FPointerEvent

(
    const FVector2D& InScreenSpacePosi...,
    const FVector2D& InLastScreenSpace...,
    const TSet< FKey >& InPressedButto...,
    const FModifierKeysState& InModifi...,
    EGestureEvent InGestureType,
    const FVector2D& InGestureDelta,
    bool bInIsDirectionInvertedFromDevi...
)

A constructor for gesture events

Public function

FPointerEvent

(
    uint32 InUserIndex,
    uint32 InPointerIndex,
    const FVector2D& InScreenSpacePosi...,
    const FVector2D& InLastScreenSpace...,
    const TSet< FKey >& InPressedButto...,
    FKey InEffectingButton,
    float InWheelDelta,
    const FModifierKeysState& InModifi...
)

Public function

FPointerEvent

(
    uint32 InUserIndex,
    uint32 InPointerIndex,
    const FVector2D& InScreenSpacePosi...,
    const FVector2D& InLastScreenSpace...,
    float InForce,
    bool bPressLeftMouseButton,
    bool bInIsForceChanged,
    bool bInIsFirstMove,
    const FModifierKeysState& InModifi...,
    uint32 InTouchpadIndex
)

Functions

Name Description

Public function Const

const FVecto...

 

GetCursorDelta()

Returns the distance the mouse traveled since the last event was handled.

Public function Const

FKey

 

GetEffectingButton()

Mouse button that caused this event to be raised (possibly EB_None)

Public function Const

const FVecto...

 

GetGestureDelta()

Returns the change in gesture value since the last gesture event of the same type.

Public function Const

EGestureEven...

 

GetGestureType()

Returns the type of touch gesture

Public function Const

const FVecto...

 

GetLastScreenSpacePosition()

Returns the position of the cursor in screen space last time we handled an input event

Public function Const

uint32

 

GetPointerIndex()

Returns the unique identifier of the pointer (e.g., finger index)

Public function Const

const TSet< ...

 

GetPressedButtons()

Returns the full set of pressed buttons

Public function Const

const FVecto...

 

GetScreenSpacePosition()

Returns The position of the cursor in screen space

Public function Const

float

 

GetTouchForce()

Returns the force of a touch (1.0f is mapped to an general touch force, < 1 is "light", > 1 is "heavy", and 10 is the max force possible)

Public function Const

uint32

 

GetTouchpadIndex()

Returns the index of the touch pad that generated this event (for platforms with multiple touch pads per user)

Public function Const

int32

 

GetUserIndex()

Returns the index of the user that caused the event

Public function Const

float

 

GetWheelDelta()

How much did the mouse wheel turn since the last mouse event

Public function Const

bool

 

IsDirectionInvertedFromDevice()

Is the gesture delta inverted

Public function Const

bool

 

IsMouseButtonDown

(
    FKey MouseButton
)

Mouse buttons that are currently pressed

Public function Const

bool

 

IsTouchEvent()

Is this event a result from a touch (as opposed to a mouse)

Public function Const

bool

 

IsTouchFirstMoveEvent()

Is this event a special first-move touch event

Public function Const

bool

 

IsTouchForceChangedEvent()

Is this event a special force-change touch event

Public function Static

PointerEvent...

 

MakeTranslatedEvent

(
    const PointerEventType& InPointerE...,
    const FVirtualPointerPosition& Vir...
)

Overridden from FInputEvent

Name Description

Public function Virtual Const

bool

 

IsPointerEvent()

Is this event a pointer event (touch or cursor).

Public function Virtual Const

FText

 

ToText()

Operators

Name Description

Public function

void

 

operator=

(
    const FPointerEvent& Other
)

We override the assignment operator to allow generated code to compile with the const ref member.

Deprecated Functions

Name Description

Public function

 

FPointerEvent

(
    uint32 InUserIndex,
    uint32 InPointerIndex,
    const FVector2D& InScreenSpacePosi...,
    const FVector2D& InLastScreenSpace...,
    bool bPressLeftMouseButton,
    const FModifierKeysState& InModifi...,
    uint32 InTouchpadIndex
)

FPointerEvent constructor now takes a Force parameter

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