   key definitions from file
  Hi, I wonder if its possible to load the keyinput configuration from a file (in an XNA game using C#).I thought of the following:Keys KEY_FORWARD;...StreamReader reader = new StreamReader("inputconfiguration.txt");string s = reader.ReadLine();KEY_FORWARD = Int32.Parse(s);reader.Close();But I can't seem to set the value of the Key.  The string s contains the value tho.   
  If I understand what you're asking, you might want to try Enum.Parse() instead of Int32.Parse().   ;  It doesnt seem to work, Im trying the followingKey KEY_UP;KEY_UP = (Keys)Enum.Parse(typeof(Keys), "W");(tho no error or crash);  If you don't want to handle all of the serialization/deserialization stuff yourself, you can just create a class to hold all of your key associations and then use XML serialization.class KeyBindings{    public Keys ForwardKey = Keys.Up;    public Keys BackKey = Keys.Down;    ...}This is nice because if you add a new key binding, you don't have to also modify your serialization code.  Plus it will write everything in an organized human-readable format.   ;Quote:Original post by frankfrankIt doesnt seem to work, What's the problem? It seems to work for me (well once I corrected Key KEY_UP to Keys KEY_UP anyways).   