@JackscarIitt’s solution will work fine for KeyCode Enums. There is also a lesser known way to do this however. Each enum is represented by an EnumItem. This object has properties Name, Value, and EnumType. To convert Enum.KeyCode.E to a string value you could also just use Enum.KeyCode.E.Name.
This won’t work for all cases; for example, if you press space, Enum.KeyCode.Space.Name will give you the string "Space", which is probably not what you want. You’re probably looking for the string ' '.