Hello,
I have created a custom input device, but I cannot manage to insert my custom key. I have tried this: How do you integrate a custom input device with the engine input and axis mappings? - Programming & Scripting - Epic Developer Community Forums
But it’s not working.
I have created a struct:
struct MyControllerKey
{
static const FKey Key1;
static const FKey Key2;
};
And I have added the new key in CreateInputDevice method, but the AddKey method does not work (link error):
virtual TSharedPtr<class IInputDevice> CreateInputDevice(const TSharedRef<FGenericApplicationMessageHandler>& InMessageHandler)
{
EKeys::AddKey(FKeyDetails(MyControllerKey::Key1, LOCTEXT("Key1", "Key1"), FKeyDetails::GamepadKey));
return MakeShareable(new FControllerInputDevice(InMessageHandler));
}
This line also gives me problem too, because the first parameter want a FGamepadKeyNames and not a FKey:
FSlateApplication::Get().OnControllerButtonPressed(MyControllerKey::Key1, 0, 0);
Any help or examples would be awesome, thanks!