This is a guide for having custom code run on holdable blueprints when the player presses a key.

Start By going to the BP_SGKHoldableInterface blueprint and copy the video below.

Next go to the BP_SGKMasterCharacter then go to the Inputs collapsed node and copy the video below.

Part One
Part Two

If you want you new key input to be re bindable in the controls menu you can check the Epic documentation linked below on how to add new action inputs in the project settings.

https://www.unrealengine.com/en-US/blog/input-action-and-axis-mappings-in-ue4?sessionInvalidated=true

The next part will depend on which holdables you want to use the new keybind. If you want the new keybind to be used for all holdables then you can add your custom code into the BP_MasterHoldable.

If you only want to use the key bind for melee weapons or range weapons you can use either the BP_MasterRangeWeapon or the BP_MasterMeleeWeapon. If you only want the keybind to run on spacific holdables then you can add the event shown below to the holdable blueprints you want such as the BP_M4A4.

Note – that the event will only run on server

You can now use the new event to run your own custom code!

You can also add checks to stop the event running if the player is for example in their inventory, in action or falling like the image below shows.