Download

[Full Project] Rama's UMG Rebindable Key System, Rebind keys at Runtime!

I may have fix my problem, i’m sharing here two new function i made to add in your VictoryBPLibrary, they allow you to add axis and action input:

For the Axis :
to add in Header :


UFUNCTION(BlueprintCallable, Category = "Victory Library | Key Rebinding")
		static void AddInputAxis(FName AxisNameToAdd, FKey NewAxisKey, float AxisScale);

and in the cpp :

void UVictoryBPFunctionLibrary::AddInputAxis(FName AxisToAdd, FKey NewAxisKey)
{
	UInputSettings* Settings = GetMutableDefault<UInputSettings>();
	if (!Settings)return;
	FInputAxisKeyMapping AxisAdd = AxisAdd.AxisName = AxisNameToAdd;
	AxisAdd.Key = NewAxisKey;
	AxisAdd.Scale = AxisScale;

	TArray<FInputAxisKeyMapping>&Axi = Settings->AxisMappings;
	Axi.Add(AxisAdd);
	for (TObjectIterator<UPlayerInput> It; It; ++It)
	{
		It->ForceRebuildingKeyMaps(true);
	}
}

For the Action :

Header :


UFUNCTION(BlueprintCallable, Category = "Key Rebinding")
		static void AddInputAction(FName ActionNameToAdd, FKey NewActionKey);


cpp :


void UVictoryBPFunctionLibrary::AddInputAction(FName ActionNameToAdd, FKey NewActionKey)
{
	UInputSettings* Settings = GetMutableDefault<UInputSettings>();
	if (!Settings)return;


	FInputActionKeyMapping ActionAdd = ActionAdd.ActionName = ActionNameToAdd;
	ActionAdd.Key = NewActionKey;

	TArray<FInputActionKeyMapping>&Actio = Settings->ActionMappings;
	Actio.Add(ActionAdd);
	for (TObjectIterator<UPlayerInput> It; It; ++It)
	{
		It->ForceRebuildingKeyMaps(true);
	}


}

769a245d83b5353a47236089308fd7a360d36446.png

Hi Rama ! Great job with your plugin :slight_smile: But I got a problem. Why I can’t have axis and action bindings in the same widget ? When I put them into the same widget via Wrap Box or Widget Switcher, I can only change action key bindings and axis don’t respond to my key pressing. If someone know how to fix, it let me know :o

Thanks for this Rama, awesome job. I have a quick question. On my axis mappings, it dies not pick up the axis, for example, when i set my forward axis, its just gamepad thumb-stick left Up, not the axis. So if i move it down, it picks up : gamepad thumb-stick left down, not gamepad thumb-stick Axis. Any ideas where I am going wrong?

Thanks, Shaun :slight_smile:

Rama, this is great!

Couple things though - your RemoveAxis/RemoveAction functions don’t account for the fact a single key might be bound to several axes/actions and we might want to remove the bindings only on axes/actions specified in struct passed to function. And you really should integrate those AddAxis/AddAction nodes - the whole thing is incomplete without them.

Any chance of making the keybind system independant from victory plugin?. Ty

your download is 4.10, will this update cleanly to 4.12?

Two questions:

  1. Will this work in 4.13/4.14?

  2. Why in the world hasn’t Epic implemented this kind of functionality in the engine itself??? Madness!

Rama Key Rebinding 4.15

Dear Community,

I’ve updated my Key Rebinding full project to 4.15 for oyu!

I include the relevant version of Victory Plugin now, so I am using media fire instead of the wiki:

Wiki Download Page ( prior versions )

Direct Link:

Enjoooy!

:heart:

Rama

Hey Rama

Thanks for your project but I have some problems. I can’t set the new key to be a gamepad key or axis. Any way to change that? ^^

And there is no Deprecated Set Input mode UI only :confused:

Dear Rama, how difficult it would be to create “default input settings” button? In case of user doesn’t want to rebind each button manualy to its default value.

Thank you for your hardwork.

Check out CardinalMenu https://forums.unrealengine.com/showthread.php?121203-Community-Project-Blueprints-Cardinal-Menu-System-Steam-and-LAN-Server-Browser-w-Friends-List

The menu system has gotten a bit complicated, but it works. You can modify CardinalMenu’s Set Default Input method and use it in your own game.

So I had the same problems with the ordering, and I fixed it just by calling Settings->SaveConfig() instead of Settings->SaveKeyMappings() to skip the sorting step. Hopefully this helps others with the headache of dealing with this too!

Brilliant! What do you think @Rama?

Hi, this is awesome! can you please update for 4.17? thank you :slight_smile:

Looks cool, would be good if it was updated to 4.17 or if we could at least get a source to see the solution and update it ourselves.

Hi, I’m loving the pluging and it works great 99% of the time but im having trouble with the Shift/Ctrl/Alt functions. an example below
Function 1 uses key “1”
Function 2 uses key “Shift+1”
now this works and displays fine when first set in the project settings but as soon as i try and rebind function 2 it loses the ability to use the Shift/Ctrl/Alt functions, it only picks up the first key pressed or if i try and click the Shift check box after setting the key it display it but doesnt actually save it.

I can reproduce this in the default project “ReBindableKeys15” although i use engine 4.16 and updated the victory plugin to the same version.

Anybody got any suggestion?

Hi Rama!

Great toolset here, was wondering if we could get an update to 4.19 please? Thanks!

Swin

In 4.20 this function is not even accessible, because everything in UInputSettings is private.

Hello. I wonder, if it is possible to get axis remap working on later UE versions (i am trying 4.19)? Button remap works, axis does not “feel” any input. Thank You.