How to create an event type from int or string?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By EulersIdentity
:warning: Old Version Published before Godot 3 was released.

I’m trying to change the input map with InputMap.action_add_event(action,event) and I’m getting the event from a file. How can I take something like KEY_A or 65 and turn it into an InputEvent of the ‘A’ key being pressed so I can pass it to action_add_event() ?