How can I trigger a custom event when the player picks up an item using C++?

Or Overlap or press a Key… the two things at the same time is not possible.

A Event in C++ is a simple fuction and that is all.

Or this:

void OnActorBeginOverlap(AActor* OverlappedActor, AActor* Other)
{
     MyFunction();
}

Or this:

void OnSomeKeyPressed()
{
     MyFunction();
}

You can expose it as event in blueprint:

UFUNCTION(BlueprintNativeEvent)
void  MyFunction();

Or can expose it as fuction in blueprint:

UFUNCTION(BlueprintCallable)
void  MyFunction();

That’s all elegant it can be