UI - Multiple Keys for On Pressed Event

Is there a way to change or add what keyboard keys or gamepad buttons will trigger the “On Pressed” button event in the UI? If so how would I differentiate which button triggered it? My goal is to have a UI button respond one way when say the A button is pressed but behave a different way when say the B button is pressed.

Yes in the override functions setup on key down then query the key pressed with your desired input

What I ended up doing was leaving the default button pressed function alone. I then just set all my enhanced inputs in my character bp to operate outside of pause and then just put in a simple bool after those inputs to check if I was in the menu or not, if in the menu, the enhanced input then just ran a custom event in the widget that did whatever menu stuff I wanted.