UKismetInputLibrary::PointerEvent_GetLastScreenSpacePosition
#include "Kismet/KismetInputLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Returns the cursor's screen-space position as of the previous pointer event, useful for computing movement manually.
Caveats & Gotchas
- • Prefer PointerEvent_GetCursorDelta if you just need the movement vector — subtracting this from the current position duplicates work the engine already does.
- • Only updates on pointer events; it doesn't track position between events if the pointer is captured or hidden.
Signature
static FVector2D PointerEvent_GetLastScreenSpacePosition(const FPointerEvent& Input); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Input | const FPointerEvent& | The pointer event to read the previous cursor position from. | — |
Return Type
FVector2D Example
Draw a debug trail between the last and current position C++
FReply UMyWidget::NativeOnMouseMove(const FGeometry& InGeometry, const FPointerEvent& InMouseEvent)
{
const FVector2D LastPos = UKismetInputLibrary::PointerEvent_GetLastScreenSpacePosition(InMouseEvent);
const FVector2D CurrentPos = UKismetInputLibrary::PointerEvent_GetScreenSpacePosition(InMouseEvent);
DrawDebugTrail(LastPos, CurrentPos);
return FReply::Handled();
} See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?