Using Keyboard Control in a Widget

I will post a setup of how to do this when I get home, you basically want to create the widget in UMG. Then from your character you want to say, when you press x key split to a switch node, the first point will create the widget and then add it to viewport, the second point will drag off and remove the widget from the viewport.

This link may also be useful: Creating Widgets | Unreal Engine Documentation