How to force a button to focus and activate a key selector?

I’ve buttons that are providing better styling of inputs, but I need the key selector behavior for the rebinding. Is there a way to activate the key selector from a button press? As it stands I have it focusing it fine, but then you have to press enter a second time to actually activate the key selector. I want that to happen automatically.