Last active
March 9, 2020 15:20
-
-
Save PapeCoding/e799a87334916d431c1f64947b3240bb to your computer and use it in GitHub Desktop.
This allows binding "keys" to functions indirectly, by introducing a unique action, which calls your method with your parameter(s).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Declare inside your Unreal Class | |
DECLARE_DELEGATE_OneParam(FMyActionDelegate, float); | |
//Do in function like BeginPlay or the StartupModule function of your Plugin | |
UInputSettings::GetInputSettings()->AddActionMapping(FInputActionKeyMapping(TEXT("MyTestAction"),EKeys::T)); | |
UInputSettings::GetInputSettings()->SaveKeyMappings(); | |
InputComponent->BindAction<FMyActionDelegate>(TEXT("MyTestAction"),EInputEvent::IE_Pressed,this,&MyClass::MyFunctionHandler,-0.1337f); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment