OnClicked.AddDynamic - no arguments expected in Delegate?

In order to assign functionality to some buttons in C++, I decided to use OnClicked.AddDynamic. From reading past threads I learned that OnClicked.AddDynamic delegates were changed some time ago to take two parameters - an object pointer and the FKey that was pressed. Yet strangely, I cannot get the AddDynamic call to compile unless the function that I am attempting to bind has no parameters. Otherwise, I receive an error along the lines of “cannot convert argument 2 from ‘void (__cdecl ASurvivalGameCharacter::* )(UPrimitiveComponent ,FKey)’ to 'void (__cdecl ASurvivalGameCharacter:: )(void)’”. This puts me in a difficult situation, as I need to use that parameter to differentiate between several different buttons that all call the same function when clicked. Could anyone help get me on the right track with this? The relevant code is below:

SurvivalGameCharacter.h:

UFUNCTION() void handleInventoryButtonPress(UPrimitiveComponent* pComponent, FKey inKey);

SurvivalGameCharacter.cpp:

for (int i = 0; i < inventorySize; ++i)
		inventoryButtons[i]->OnClicked.AddDynamic(this, &ASurvivalGameCharacter::handleInventoryButtonPress);
.
.
.
void ASurvivalGameCharacter::handleInventoryButtonPress(UPrimitiveComponent* pComponent, FKey inKey) { }

I always asssign functions with zero parameters to buttons. I dont know why you would wanna have different buttons which call the same function, but if you still want to differentiate between them, you could bind delegates to your different buttons: e.g. CallButton_1 and CallButton_2 and these functions call your handleInventoryButtonPress with given button.

e.g.

void CallButton_2() {

   handleInventoryButtonPress(Button_2, 

…);

}

Ah, zero parameters must be intended now after all. Your proposition makes sense, it’s definitely something I was considering as a last resort. To give some more context, the inventory can be controlled via a grid of buttons. Clicking any button performs the same function but with the correct index specified, informing the function of the inventory item on which to operate. Ultimately, I ended up working with the zero parameter delegate function, and iterated over the grid button array in a ParallelFor to locate the button whose IsHovered returns true. It feels a little hacky, but from my tests and reasoning it seems like a reliable solution, and should not have any noticeable effect on performance.