Navigation
API > API/Runtime > API/Runtime/Engine
A basic command line console that accepts most commands.
| Name | UConsole |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Engine/Console.h |
| Include Path | #include "Engine/Console.h" |
Syntax
UCLASS (Within=GameViewportClient, Config=Input, Transient, MinimalAPI)
class UConsole :
public UObject ,
public FOutputDevice
Inheritance Hierarchy
- FOutputDevice → UConsole
- UObjectBase → UObjectBaseUtility → UObject → UConsole
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UConsole
(
const FObjectInitializer& ObjectInitializer |
Engine/Console.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~UConsole() |
Engine/Console.h |
Structs
| Name | Remarks |
|---|---|
| ScrollbackSelection | Scrollback region selection mouse and state. |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOnConsoleActivationStateChanged | TMulticastDelegate_OneParam< void, bool > | Delegate for when the console is activated or deactivated | Engine/Console.h |
| FRegisterConsoleAutoCompleteEntries | TMulticastDelegate_OneParam< void, TArray< FAutoCompleteCommand > & > | Delegate for registering hot-reloaded classes that have been added | Engine/Console.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| MAX_HISTORY_ENTRIES | const int32 | Max number of command history entries | Engine/Console.h |
| OnConsoleActivationStateChanged | FOnConsoleActivationStateChanged | Engine/Console.h | |
| RegisterConsoleAutoCompleteEntries | FRegisterConsoleAutoCompleteEntries | Engine/Console.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AutoComplete | TArray< FAutoCompleteCommand > | Current list of matching commands for auto-complete, | Engine/Console.h | |
| AutoCompleteCursor | int32 | -1: auto complete cursor is not visible, >=0 | Engine/Console.h | |
| AutoCompleteIndex | int32 | Currently selected auto complete index | Engine/Console.h | |
| AutoCompleteList | TArray< FAutoCompleteCommand > | Full list of auto-complete commands and info | Engine/Console.h | |
| AutoCompleteTree | FAutoCompleteNode | Engine/Console.h | ||
| bAutoCompleteLocked | uint32 | Is the current auto-complete selection locked | Engine/Console.h | |
| bCaptureKeyInput | uint32 | Indicates that InputChar events should be captured to prevent them from being passed on to other interactions. | Engine/Console.h | |
| bCtrl | uint32 | True while a control key is pressed. | Engine/Console.h | |
| bIsRuntimeAutoCompleteUpToDate | uint32 | Do we need to rebuild auto complete? | Engine/Console.h | |
| bShift | uint32 | True while a shift key is pressed. | Engine/Console.h | |
| ConsoleState | FName | NAME_Typing, NAME_Open or NAME_None. | Engine/Console.h | |
| ConsoleTargetPlayer | TObjectPtr< class ULocalPlayer > | The player which the next console command should be executed in the context of. | Engine/Console.h | |
| DefaultTexture_Black | TObjectPtr< class UTexture2D > | Engine/Console.h | ||
| DefaultTexture_White | TObjectPtr< class UTexture2D > | Engine/Console.h | ||
| HistoryBuffer | TArray< FString > | Holds the history buffer, order is old to new | Engine/Console.h |
|
| LastAutoCompletedCommand | FString | The most recent input that was autocompleted during this open console session. | Engine/Console.h | |
| PrecompletedInputLine | FString | The command the user would get if they autocompleted their current input. | Engine/Console.h | |
| SBHead | int32 | Index to the next slot to be filled in the scrollback buffer. | Engine/Console.h | |
| SBPos | int32 | Scrollback position offset (0 = view newest entries, increases to view older entries) | Engine/Console.h | |
| Scrollback | TArray< FString > | Holds the scrollback buffer | Engine/Console.h | |
| Selection | UConsole::ScrollbackSelection | Engine/Console.h | ||
| TextH | float | Engine/Console.h | ||
| TextW | float | Engine/Console.h | ||
| TypedStr | FString | The command the user is currently typing. | Engine/Console.h | |
| TypedStrPos | int32 | Engine/Console.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bDPIAwareStringMeasurement | const bool | Engine/Console.h | ||
| ConsoleSettings | const UConsoleSettings * | Console settings from BaseInput.ini. | Engine/Console.h | |
| PreviousFocusedWidget | TWeakPtr< SWidget > | Widget that was focused before the console was opened (focus will be restored to this if it's valid after the console closes) | Engine/Console.h | |
| PreviousMouseCaptureMode | EMouseCaptureMode | Previous mouse capture mode of the viewport before the console was opened (mouse capture mode must be restored to its previous state) | Engine/Console.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void AppendInputText
(
const FString& Text |
Appends the specified text to the string of typed text | Engine/Console.h | |
virtual void AugmentRuntimeAutoCompleteList
(
TArray< FAutoCompleteCommand >& List |
Virtual function to allow subclasses of UConsole to add additional commands | Engine/Console.h | |
virtual void BeginState_Open
(
FName PreviousStateName |
Perform actions on transition to the Open state | Engine/Console.h | |
virtual void BeginState_Typing
(
FName PreviousStateName |
Perform actions on transition to Typing state | Engine/Console.h | |
virtual void BuildRuntimeAutoCompleteList
(
bool bForce |
Build the list of auto complete console commands | Engine/Console.h | |
virtual void CapturedMouseMove
(
FViewport* InViewport, |
Engine/Console.h | ||
virtual void ClearOutput() |
Clears the console output buffer. | Engine/Console.h | |
virtual bool ConsoleActive() |
Engine/Console.h | ||
virtual void ConsoleCommand
(
const FString& Command |
Executes a console command. | Engine/Console.h | |
virtual void EndState_Open
(
FName NextStateName |
Perform actions on transition from Open state | Engine/Console.h | |
virtual void EndState_Typing
(
FName NextStateName |
Perform actions on transition from Typing state | Engine/Console.h | |
virtual void FakeGotoState
(
FName NextStateName |
Controls state transitions for the console | Engine/Console.h | |
virtual void FlushPlayerInput() |
Clears out all pressed keys from the player's input object. | Engine/Console.h | |
virtual bool InputAxis
(
FInputDeviceId DevideId, |
Engine/Console.h | ||
virtual bool InputChar
(
FInputDeviceId DeviceId, |
Engine/Console.h | ||
virtual bool InputChar_Open
(
FInputDeviceId DeviceId, |
This state is used when the console is open. | Engine/Console.h | |
virtual bool InputChar_Typing
(
FInputDeviceId DeviceId, |
Process a character input event (typing) routed through unrealscript from another object. | Engine/Console.h | |
virtual bool InputKey
(
FInputDeviceId DeviceId, |
Engine/Console.h | ||
virtual bool InputKey_Open
(
FInputDeviceId DeviceId, |
Process an input key event routed through unrealscript from another object. | Engine/Console.h | |
virtual bool InputTouch
(
FInputDeviceId DevideId, |
Engine/Console.h | ||
void InvalidateAutocomplete() |
Engine/Console.h | ||
virtual void MouseMove
(
FViewport* Viewport, |
Engine/Console.h | ||
virtual void OutputText
(
const FString& Text |
Prints a (potentially multi-line) FString of text to the console. | Engine/Console.h | |
virtual void PostRender_Console
(
UCanvas* Canvas |
Render to the canvas based on the console state | Engine/Console.h | |
virtual void PostRender_Console_Open
(
UCanvas* Canvas |
Perform rendering of the console on the canvas | Engine/Console.h | |
virtual void PostRender_Console_Typing
(
UCanvas* Canvas |
Perform rendering of the console on the canvas | Engine/Console.h | |
virtual bool ProcessControlKey
(
FKey Key, |
Looks for Control key presses and the copy/paste combination that apply to both the console bar and the full open console | Engine/Console.h | |
virtual bool ProcessShiftKey
(
FKey Key, |
Looks for Shift key presses | Engine/Console.h | |
virtual void SetCursorPos
(
int32 Position |
Set cursor position for typing text | Engine/Console.h | |
virtual void SetInputText
(
const FString& Text |
Set the input to text | Engine/Console.h | |
virtual void StartTyping
(
const FString& Text |
Opens the typing bar with text already entered. | Engine/Console.h | |
virtual void UpdateCompleteIndices() |
Update the auto complete indices from the typed string | Engine/Console.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostInitProperties() |
Engine/Console.h |