You can do Enum.KeyCode[character] where character is a string like “E”. You will have to handle some keys specially though, since they have names that aren’t what they literally are. The 1 key is Enum.KeyCode.One for example.
Loadstring is off by default but can be turned on, I think in ServerScriptService. I strongly advise you don’t do this though, it creates a really dangerous security hole since someone can write any lua script into the keybind text box and it will run it. Making that system safe requires knowing a lot about how Lua works under the hood.