referring to the OnPressed/OnReleased functionality. I have tried Overriding FNavigationConfig but maybe I didnt do it right:
#pragma once
#include "CoreMinimal.h"
#include "Framework/Application/NavigationConfig.h"
/**
*
*/
class CustomNavigationConfig : public FNavigationConfig
{
public:
EUINavigationAction GetNavigationActionFromKey(const FKeyEvent& InKeyEvent);
};
#include "CustomNavigationConfig.h"
EUINavigationAction CustomNavigationConfig::GetNavigationActionFromKey(const FKeyEvent& InKeyEvent)
{
GEngine->AddOnScreenDebugMessage(-1, 2000.0, FColor::Blue, " runs FromKey");
if (InKeyEvent.GetKey() == EKeys::RightMouseButton)//I can set the desired button as a reference to the save file so I only need one CustomNavigaitonConfig file
{
return EUINavigationAction::Accept;
}
return EUINavigationAction::Invalid;
}
void CustomNavigationConfig::OnRegister()
{
UserNavigationState.Reset();
GEngine->AddOnScreenDebugMessage(-1, 2000.0, FColor::Blue, "registered");
}
if (InKeyEvent.GetKey() == EKeys::H)
{
TSharedPtr<CustomNavigationConfig> newConfig( new CustomNavigationConfig());
FSlateApplication::Get().SetNavigationConfig(newConfig.ToSharedRef());
}
The debug message from OnRegister is printing but none of my input actions there on trigger the debug message in GetNavigationActionFromKey
Another potential solution could be to subclass SButton and write in a new SLATE_EVENT but it is not clear to me currently how slate events bind to inputs, or really work at all in general.