How to change text color of Input Key Selector?

Set Text Style does nothing

Appearance → Text Style → Color - untick Inherit.

1 Like

That didn’t work. None of Set Text Style variables work. Set Style is working fine though

Sorry to dig up the subject but have you fixed the problem or is this really a bug?

I am also having this issue. Not sure why but I’m on UE4.26.2 and set text style for input key selectors seems to do nothing.

If you have the source engine we can treat the TextBlock inside the selector as a normal one.
You can resolve this way:

In InputKeySelector.h add:

UFUNCTION(BlueprintCallable, Category="Appearance")
void SetColorAndOpacity(FSlateColor InColorAndOpacity);

and in the .cpp:

void UInputKeySelector::SetColorAndOpacity(FSlateColor InColorAndOpacity)
{
	MyInputKeySelector->SetTextColorAndOpacity(InColorAndOpacity);
}

Then in SInputKeySelector.h add:

void SetTextColorAndOpacity(FSlateColor InColorAndOpacity);

and in the cpp:

void SInputKeySelector::SetTextColorAndOpacity(FSlateColor InColorAndOpacity)
{
	if (TextBlock.IsValid())
	{
		TextBlock->SetColorAndOpacity(InColorAndOpacity);
	}
}

Now you can call the function from blueprint:

image