Navigation
API > API/Plugins > API/Plugins/EnhancedInput > API/Plugins/EnhancedInput/UserSettings
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- USaveGame
- UEnhancedInputUserSettings
References
| Module | EnhancedInput |
| Header | /Engine/Plugins/EnhancedInput/Source/EnhancedInput/Public/UserSettings/EnhancedInputUserSettings.h |
| Include | #include "UserSettings/EnhancedInputUserSettings.h" |
Syntax
UCLASS&40;Config&61;GameUserSettings, DisplayName&61;"Enhanced Input User Settings &40;Experimental&41;",
Category&61;"Enhanced Input&124;User Settings"&41;
class UEnhancedInputUserSettings : public USaveGame
Remarks
The Enhanced Input User Settings class is a place where you can put all of your Input Related settings that you want your user to be able to change. Things like their key mappings, aim sensitivity, accessibility settings, etc. This also provides a Registration point for Input Mappings Contexts (IMC) from possibly unloaded plugins (i.e. Game Feature Plugins). You can register your IMC from a Game Feature Action plugin here, and then have access to all the key mappings available. This is very useful for building settings screens because you can now access all the mappings in your game, even if the entire plugin isn't loaded yet.
The user settings are stored on each UEnhancedPlayerInput object, so each instance of the settings can represent a single User or Local Player.
To customize this for your game, you can create a subclass of it and change the "UserSettingsClass" in the Enhanced Input Project Settings.
Variables
| Type | Name | Description | |
|---|---|---|---|
| FGameplayTag | CurrentProfileIdentifier | The current key profile that is equipped by the user. | |
| FTimerHandle | DeferredSettingsChangedTimerHandle | Used to track when a settings change callback has been deferred till the next frame. | |
| FMappableKeyProfileChanged | OnKeyProfileChanged | ||
| FMappingContextRegisteredWithSettings | OnMappingContextRegistered | ||
| FEnhancedInputUserSettingsApplied | OnSettingsApplied | ||
| FEnhancedInputUserSettingsChanged | OnSettingsChanged | ||
| TWeakObjectPtr< ULocalPlayer > | OwningLocalPlayer | The owning Local Player object of these settings | |
| TSet< TObjectPtr< const UInputMappingContext > > | RegisteredMappingContexts | Set of currently registered input mapping contexts that may not be currently active on the user, but you want to track for creating a menu for key mappings. | |
| TMap< FGameplayTag, TObjectPtr< UEnhancedPlayerMappableKeyProfile > > | SavedKeyProfiles | All of the known Key Profiles for this user, including the currently active profile. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | Apply any custom input settings to your user. | ||
| void | Asynchronously save the settings to a hardcoded save game slot. | ||
| UEnhancedPlayerMappableKeyProfile * | CreateNewKeyProfile
(
const FPlayerMappableKeyProfileCreationArgs& InArgs |
Creates a new profile with this name and type. | |
| FHardwareDeviceIdentifier | DetermineHardwareDeviceForActionMapping
(
const FEnhancedActionKeyMapping& ActionMapping |
Determines the hardware device that an action key mapping is associated with. | |
| const FPlayerKeyMapping * | FindCurrentMappingForSlot
(
const FName MappingName, |
Returns the current player key mapping for the given row name in the given slot | |
| const UInputAction * | FindInputActionForMapping
(
const FName MappingName |
Returns the Input Action associated with the given player mapping name | |
| const TSet< FPlayerKeyMapping > & | FindMappingsInRow
(
const FName MappingName |
Returns a set of all player key mappings for the given mapping name. | |
| const TMap< FGameplayTag, TObjectPtr< UEnhancedPlayerMappableKeyProfile > > & | Returns all player saved key profiles | ||
| UEnhancedPlayerMappableKeyProfile * | Get the current key profile that the user has set | ||
| T * | Get the current key profile that the user has set | ||
| const FGameplayTag & | Gets the currently selected key profile | ||
| UEnhancedPlayerMappableKeyProfile * | GetKeyProfileWithIdentifier
(
const FGameplayTag& ProfileId |
Returns the key profile with the given name if one exists. Null if one doesn't exist | |
| T * | GetKeyProfileWithIdentifierAs
(
const FGameplayTag& ProfileId |
Returns the key profile with the given name if one exists. Null if one doesn't exist | |
| ULocalPlayer * | |||
| const TSet< TObjectPtr< const UInputMappingContext > > & | Gets all the currently registered mapping contexts with the settings | ||
| void | Initialize
(
ULocalPlayer* LP |
||
| bool | IsMappingContextRegistered
(
const UInputMappingContext* IMC |
Returns true if this mapping context is currently registered with the settings | |
| UEnhancedInputUserSettings * | LoadOrCreateSettings
(
ULocalPlayer* LP |
Loads or creates new user settings for the owning local player of the given player input | |
| void | MapPlayerKey
(
const FMapPlayerKeyArgs& InArgs, |
Sets the player mapped key on the current key profile. | |
| void | OnAsyncSaveComplete
(
const FString& SlotName, |
||
| void | OnKeyMappingRegistered
(
FPlayerKeyMapping& RegisteredMapping, |
A virtual function that will be called whenever a player key mapping is first registered. | |
| void | OnKeyMappingUpdated
(
FPlayerKeyMapping* ChangedMapping, |
A virtual function that will be called whenever a player key mapping has been updated, before OnSettingsChanged is called. | |
| bool | RegisterInputMappingContext
(
const UInputMappingContext* IMC |
Registers this mapping context with the user settings. | |
| bool | RegisterInputMappingContexts
(
const TSet< UInputMappingContext* >& MappingContexts |
Registers multiple mapping contexts with the settings | |
| bool | RegisterKeyMappingsToProfile
(
UEnhancedPlayerMappableKeyProfile& Profile, |
This will register individual key mappings from the given Input Mapping context on the profile id. | |
| void | ResetAllPlayerKeysInRow
(
const FMapPlayerKeyArgs& InArgs, |
Resets each player mapped key to it's default value from the Input Mapping Context that it was registered from. | |
| void | ResetKeyProfileToDefault
(
const FGameplayTag& ProfileId, |
Resets the given key profile to default key mappings | |
| void | SaveSettings () |
Synchronously save the settings to a hardcoded save game slot. | |
| bool | SetKeyProfile
(
const FGameplayTag& InProfileId |
Changes the currently active key profile to the one with the given name. | |
| void | ShowDebugInfo
(
UCanvas* Canvas |
Draw debug information on the screen for these user settings. | |
| void | ShowDebugInfoInternal
(
UCanvas* Canvas |
Provides a space for subclasses to add additional debug info if desired. | |
| void | UnMapPlayerKey
(
const FMapPlayerKeyArgs& InArgs, |
Unmaps a single player mapping that matches the given Mapping name, slot, and hardware device. | |
| bool | UnregisterInputMappingContext
(
const UInputMappingContext* IMC |
Removes this mapping context from the registered mapping contexts | |
| bool | UnregisterInputMappingContexts
(
const TSet< UInputMappingContext* >& MappingContexts |
Removes multiple mapping contexts from the registered mapping contexts |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | Handles reading, writing, and reference collecting using FArchive. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FEnhancedInputUserSettingsApplied | Called after the settings have been applied from the ApplySettings call. | ||
| FEnhancedInputUserSettingsChanged | Fired when the user settings have changed, such as their key mappings. | ||
| FMappableKeyProfileChanged | Fired when you equip a different key profile | ||
| FMappingContextRegisteredWithSettings | Registering input mapping contexts for access to them from your UI, even if they are from a plugin Fired when a new input mapping context is registered. |