UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FGenericPlatformApplicationMisc Struct Reference

#include <GenericPlatformApplicationMisc.h>

+ Inheritance diagram for FGenericPlatformApplicationMisc:

Public Types

enum  EScreenSaverAction { Disable , Enable }
 

Static Public Member Functions

static APPLICATIONCORE_API void PreInit ()
 
static APPLICATIONCORE_API void Init ()
 
static APPLICATIONCORE_API void PostInit ()
 
static APPLICATIONCORE_API void TearDown ()
 
static void LoadPreInitModules ()
 
static void LoadStartupModules ()
 
static APPLICATIONCORE_API FOutputDeviceConsoleCreateConsoleOutputDevice ()
 
static APPLICATIONCORE_API FOutputDeviceErrorGetErrorOutputDevice ()
 
static APPLICATIONCORE_API FFeedbackContextGetFeedbackContext ()
 
static APPLICATIONCORE_API IPlatformInputDeviceMapperCreatePlatformInputDeviceManager ()
 
static APPLICATIONCORE_API class GenericApplicationCreateApplication ()
 
static APPLICATIONCORE_API void RequestMinimize ()
 
static APPLICATIONCORE_API bool IsThisApplicationForeground ()
 
static APPLICATIONCORE_API bool RequiresVirtualKeyboard ()
 
static void PumpMessages (bool bFromMainLoop)
 
static void PreventScreenSaver ()
 
static bool IsScreensaverEnabled ()
 
static bool ControlScreensaver (EScreenSaverAction Action)
 
static APPLICATIONCORE_API struct FLinearColor GetScreenPixelColor (const FVector2D &InScreenPos, float InGamma=1.0f)
 
static bool GetWindowTitleMatchingText (const TCHAR *TitleStartsWith, FString &OutTitle)
 
static void SetHighDPIMode ()
 
static float GetDPIScaleFactorAtPoint (float X, float Y)
 
static APPLICATIONCORE_API bool IsHighDPIAwarenessEnabled ()
 
static bool AnchorWindowWindowPositionTopLeft ()
 
static void SetGamepadsAllowed (bool bAllowed)
 
static void SetGamepadsBlockDeviceFeedback (bool bAllowed)
 
static void ResetGamepadAssignments ()
 
static void ResetGamepadAssignmentToController (int32 ControllerId)
 
static bool IsControllerAssignedToGamepad (int32 ControllerId)
 
static FString GetGamepadControllerName (int32 ControllerId)
 
static class UTexture2DGetGamepadButtonGlyph (const FGamepadKeyNames::Type &ButtonKey, uint32 ControllerIndex)
 
static void EnableMotionData (bool bEnable)
 
static bool IsMotionDataEnabled ()
 
static APPLICATIONCORE_API void ClipboardCopy (const TCHAR *Str)
 
static APPLICATIONCORE_API void ClipboardPaste (class FString &Dest)
 
static APPLICATIONCORE_API EScreenPhysicalAccuracy GetPhysicalScreenDensity (int32 &OutScreenDensity)
 
static APPLICATIONCORE_API EScreenPhysicalAccuracy GetPhysicalScreenDimensions (FVector2f &OutScreenDimensions)
 
static APPLICATIONCORE_API EScreenPhysicalAccuracy GetPhysicalScreenSize (float &OutScreenSize)
 
static APPLICATIONCORE_API EScreenPhysicalAccuracy ComputePhysicalScreenDensity (int32 &OutScreenDensity)
 
static APPLICATIONCORE_API EScreenPhysicalAccuracy ComputePhysicalScreenDimensions (FVector2f &OutScreenDimensions, float &OutScreenSize)
 
static void ComputePhysicalScreenData ()
 
template<typename T , typename T2 UE_REQUIRES>
static EScreenPhysicalAccuracy ConvertInchesToPixels (T Inches, T2 &OutPixels)
 
template<typename T , typename T2 UE_REQUIRES>
static EScreenPhysicalAccuracy ConvertPixelsToInches (T Pixels, T2 &OutInches)
 
static bool ShowInputDeviceSelector (FPlatformUserId InitiatingUserId, FShowInputDeviceSelectorComplete OnShowInputDeviceSelectorComplete)
 
static bool ShowPlatformUserSelector (FInputDeviceId InitiatingInputDeviceId, EPlatformUserSelectorFlags Flags, FPlatformUserSelectionComplete OnUserSelectionComplete)
 

Static Protected Attributes

static APPLICATIONCORE_API bool CachedPhysicalScreenData = false
 
static APPLICATIONCORE_API EScreenPhysicalAccuracy CachedPhysicalScreenAccuracy = EScreenPhysicalAccuracy::Unknown
 
static APPLICATIONCORE_API int32 CachedPhysicalScreenDensity = 0
 
static APPLICATIONCORE_API FAutoConsoleVariableRef CVarEnableHighDPIAwareness
 
static APPLICATIONCORE_API FAutoConsoleVariableRef CVarAllowVirtualKeyboard
 
static APPLICATIONCORE_API EScreenPhysicalAccuracy CachedPhysicalScreenDimensionsAccuracy = EScreenPhysicalAccuracy::Unknown
 
static APPLICATIONCORE_API FVector2f CachedPhysicalScreenDimensions = FVector2f::ZeroVector
 
static APPLICATIONCORE_API float CachedPhysicalScreenSize = 0.f
 

Member Enumeration Documentation

◆ EScreenSaverAction

Member Function Documentation

◆ AnchorWindowWindowPositionTopLeft()

static bool FGenericPlatformApplicationMisc::AnchorWindowWindowPositionTopLeft ( )
inlinestatic

◆ ClipboardCopy()

void FGenericPlatformApplicationMisc::ClipboardCopy ( const TCHAR Str)
static

Copies text to the operating system clipboard.

◆ ClipboardPaste()

void FGenericPlatformApplicationMisc::ClipboardPaste ( class FString &  Dest)
static

Pastes in text from the operating system clipboard.

◆ ComputePhysicalScreenData()

void FGenericPlatformApplicationMisc::ComputePhysicalScreenData ( )
static

◆ ComputePhysicalScreenDensity()

EScreenPhysicalAccuracy FGenericPlatformApplicationMisc::ComputePhysicalScreenDensity ( int32 OutScreenDensity)
static

Gets the physical size of the screen if possible. Some platforms lie, some platforms don't know.

◆ ComputePhysicalScreenDimensions()

EScreenPhysicalAccuracy FGenericPlatformApplicationMisc::ComputePhysicalScreenDimensions ( FVector2f OutScreenDimensions,
float OutScreenSize 
)
static

◆ ControlScreensaver()

static bool FGenericPlatformApplicationMisc::ControlScreensaver ( EScreenSaverAction  Action)
inlinestatic

Disables screensaver (if platform supports such an API)

Parameters
Actionenable or disable
Returns
true if succeeded, false if platform does not have this API and PreventScreenSaver() hack is needed

◆ ConvertInchesToPixels()

template<typename T , typename T2 UE_REQUIRES>
static EScreenPhysicalAccuracy FGenericPlatformApplicationMisc::ConvertInchesToPixels ( Inches,
T2 OutPixels 
)
inlinestatic

If we know or can approximate the pixel density of the screen we will convert the incoming inches to pixels on the device. If the accuracy is unknown OutPixels will be set to 0.

◆ ConvertPixelsToInches()

template<typename T , typename T2 UE_REQUIRES>
static EScreenPhysicalAccuracy FGenericPlatformApplicationMisc::ConvertPixelsToInches ( Pixels,
T2 OutInches 
)
inlinestatic

If we know or can approximate the pixel density of the screen we will convert the incoming pixels to inches on the device. If the accuracy is unknown OutInches will be set to 0.

◆ CreateApplication()

GenericApplication * FGenericPlatformApplicationMisc::CreateApplication ( )
static

Creates an application instance.

◆ CreateConsoleOutputDevice()

class FOutputDeviceConsole * FGenericPlatformApplicationMisc::CreateConsoleOutputDevice ( )
static

Creates a console output device for this platform. Should only be called once.

◆ CreatePlatformInputDeviceManager()

IPlatformInputDeviceMapper * FGenericPlatformApplicationMisc::CreatePlatformInputDeviceManager ( )
static

Gets a pointer to the default platform input device manager.

◆ EnableMotionData()

static void FGenericPlatformApplicationMisc::EnableMotionData ( bool  bEnable)
inlinestatic

◆ GetDPIScaleFactorAtPoint()

static float FGenericPlatformApplicationMisc::GetDPIScaleFactorAtPoint ( float  X,
float  Y 
)
inlinestatic

Returns monitor's DPI scale factor at given screen coordinates (expressed in pixels)

Returns
Monitor's DPI scale factor at given point

◆ GetErrorOutputDevice()

class FOutputDeviceError * FGenericPlatformApplicationMisc::GetErrorOutputDevice ( )
static

Gets a pointer to the platform error output device singleton.

◆ GetFeedbackContext()

class FFeedbackContext * FGenericPlatformApplicationMisc::GetFeedbackContext ( )
static

Gets a pointer to the default platform feedback context implementation.

◆ GetGamepadButtonGlyph()

static class UTexture2D * FGenericPlatformApplicationMisc::GetGamepadButtonGlyph ( const FGamepadKeyNames::Type ButtonKey,
uint32  ControllerIndex 
)
inlinestatic

◆ GetGamepadControllerName()

static FString FGenericPlatformApplicationMisc::GetGamepadControllerName ( int32  ControllerId)
inlinestatic

◆ GetPhysicalScreenDensity()

EScreenPhysicalAccuracy FGenericPlatformApplicationMisc::GetPhysicalScreenDensity ( int32 OutScreenDensity)
static

Gets the physical size of the screen if possible. Some platforms lie, some platforms don't know.

◆ GetPhysicalScreenDimensions()

EScreenPhysicalAccuracy FGenericPlatformApplicationMisc::GetPhysicalScreenDimensions ( FVector2f OutScreenDimensions)
static

◆ GetPhysicalScreenSize()

EScreenPhysicalAccuracy FGenericPlatformApplicationMisc::GetPhysicalScreenSize ( float OutScreenSize)
static

◆ GetScreenPixelColor()

FLinearColor FGenericPlatformApplicationMisc::GetScreenPixelColor ( const FVector2D InScreenPos,
float  InGamma = 1.0f 
)
static

Sample the displayed pixel color from anywhere on the screen using the OS

Parameters
InScreenPosThe screen coords to sample for current pixel color
InGammaOptional gamma correction to apply to the screen color
Returns
The color of the pixel displayed at the chosen location

◆ GetWindowTitleMatchingText()

static bool FGenericPlatformApplicationMisc::GetWindowTitleMatchingText ( const TCHAR TitleStartsWith,
FString &  OutTitle 
)
inlinestatic

Searches for a window that matches the window name or the title starts with a particular text. When found, it returns the title text for that window

Parameters
TitleStartsWithan alternative search method that knows part of the title text
OutTitlethe string the data is copied into
Returns
whether the window was found and the text copied or not

◆ Init()

void FGenericPlatformApplicationMisc::Init ( )
static

◆ IsControllerAssignedToGamepad()

static bool FGenericPlatformApplicationMisc::IsControllerAssignedToGamepad ( int32  ControllerId)
inlinestatic

◆ IsHighDPIAwarenessEnabled()

bool FGenericPlatformApplicationMisc::IsHighDPIAwarenessEnabled ( )
static
Returns
true if the application is high dpi aware

◆ IsMotionDataEnabled()

static bool FGenericPlatformApplicationMisc::IsMotionDataEnabled ( )
inlinestatic

◆ IsScreensaverEnabled()

static bool FGenericPlatformApplicationMisc::IsScreensaverEnabled ( )
inlinestatic

Returns state of screensaver (if platform supports it)

Returns
true if screensaver enabled (returns false if platform does not support it)

◆ IsThisApplicationForeground()

bool FGenericPlatformApplicationMisc::IsThisApplicationForeground ( )
static

Returns true if the specified application has a visible window, and that window is active/has focus/is selected

◆ LoadPreInitModules()

static void FGenericPlatformApplicationMisc::LoadPreInitModules ( )
inlinestatic

Load the preinit modules required by this platform, typically they are the renderer modules

◆ LoadStartupModules()

static void FGenericPlatformApplicationMisc::LoadStartupModules ( )
inlinestatic

Load the platform-specific startup modules

◆ PostInit()

void FGenericPlatformApplicationMisc::PostInit ( )
static

◆ PreInit()

void FGenericPlatformApplicationMisc::PreInit ( )
static

◆ PreventScreenSaver()

static void FGenericPlatformApplicationMisc::PreventScreenSaver ( )
inlinestatic

Prevents screen-saver from kicking in by moving the mouse by 0 pixels. This works even in the presence of a group policy for password protected screen saver.

◆ PumpMessages()

static void FGenericPlatformApplicationMisc::PumpMessages ( bool  bFromMainLoop)
inlinestatic

Pumps Windows messages.

Parameters
bFromMainLoopif true, this is from the main loop, otherwise we are spinning waiting for the render thread

◆ RequestMinimize()

void FGenericPlatformApplicationMisc::RequestMinimize ( )
static

Request application to minimize (goto background).

◆ RequiresVirtualKeyboard()

bool FGenericPlatformApplicationMisc::RequiresVirtualKeyboard ( )
static

Returns whether the platform wants to use a touch screen for a virtual keyboard.

◆ ResetGamepadAssignments()

static void FGenericPlatformApplicationMisc::ResetGamepadAssignments ( )
inlinestatic

◆ ResetGamepadAssignmentToController()

static void FGenericPlatformApplicationMisc::ResetGamepadAssignmentToController ( int32  ControllerId)
inlinestatic

◆ SetGamepadsAllowed()

static void FGenericPlatformApplicationMisc::SetGamepadsAllowed ( bool  bAllowed)
inlinestatic

◆ SetGamepadsBlockDeviceFeedback()

static void FGenericPlatformApplicationMisc::SetGamepadsBlockDeviceFeedback ( bool  bAllowed)
inlinestatic

◆ SetHighDPIMode()

static void FGenericPlatformApplicationMisc::SetHighDPIMode ( )
inlinestatic

Allows the OS to enable high DPI mode

◆ ShowInputDeviceSelector()

static bool FGenericPlatformApplicationMisc::ShowInputDeviceSelector ( FPlatformUserId  InitiatingUserId,
FShowInputDeviceSelectorComplete  OnShowInputDeviceSelectorComplete 
)
inlinestatic

Asyncronously display the platform-specific input device selection UI, if supported.

Parameters
InitiatingUserIdThe platform user to find an input device for.
OnShowInputDeviceSelectorCompleteCallback for when the input device selection operation has completed
Returns
true if the UI will be shown and the callback will be called
false if the platform does not support an input device selection API, or it is not currently available (the callback will not be called)

◆ ShowPlatformUserSelector()

static bool FGenericPlatformApplicationMisc::ShowPlatformUserSelector ( FInputDeviceId  InitiatingInputDeviceId,
EPlatformUserSelectorFlags  Flags,
FPlatformUserSelectionComplete  OnUserSelectionComplete 
)
inlinestatic

Asyncronously display the platform-specific user selection UI, if supported.

Parameters
InitiatingInputDeviceIdThe input device that prompted showing the UI, if applicable. The input device may be re-paired with the newly-selected user, depending on the platform
Flagscustomization options for the user selection UI.
OnUserSelectionCompletecallback for when the user selection operation has completed
Returns
true if the UI will be shown and the callback will be called
false if the platform does not support a user-selection API, or it is not currently available (the callback will not be called)

◆ TearDown()

void FGenericPlatformApplicationMisc::TearDown ( )
static

Member Data Documentation

◆ CachedPhysicalScreenAccuracy

EScreenPhysicalAccuracy FGenericPlatformApplicationMisc::CachedPhysicalScreenAccuracy = EScreenPhysicalAccuracy::Unknown
staticprotected

◆ CachedPhysicalScreenData

bool FGenericPlatformApplicationMisc::CachedPhysicalScreenData = false
staticprotected

◆ CachedPhysicalScreenDensity

int32 FGenericPlatformApplicationMisc::CachedPhysicalScreenDensity = 0
staticprotected

◆ CachedPhysicalScreenDimensions

FVector2f FGenericPlatformApplicationMisc::CachedPhysicalScreenDimensions = FVector2f::ZeroVector
staticprotected

◆ CachedPhysicalScreenDimensionsAccuracy

EScreenPhysicalAccuracy FGenericPlatformApplicationMisc::CachedPhysicalScreenDimensionsAccuracy = EScreenPhysicalAccuracy::Unknown
staticprotected

◆ CachedPhysicalScreenSize

float FGenericPlatformApplicationMisc::CachedPhysicalScreenSize = 0.f
staticprotected

◆ CVarAllowVirtualKeyboard

FAutoConsoleVariableRef FGenericPlatformApplicationMisc::CVarAllowVirtualKeyboard
staticprotected

◆ CVarEnableHighDPIAwareness

FAutoConsoleVariableRef FGenericPlatformApplicationMisc::CVarEnableHighDPIAwareness
staticprotected

The documentation for this struct was generated from the following files: