How to get a button to act as a keyboard key

I have got a game built around keyboard keys being pressed. If I want to make a GUI texture to act as the D key was pressed, how would I do that.

I think the best way is not to simulate the Keyboard key pressing, but to make an InputManager that accepts Keyboard keys or GUI button press on input, interpretates it and gives the “control signals” (what the signals it would give and how it should map keyboard keys and gui buttons - depends on your game logic).