Example #1
0
        public Action KeyAction(Keys key)
        {
            string action = ReadString(Config.KeyKey(key));

            if (string.IsNullOrEmpty(action))
            {
                return(Action.Empty);
            }
            return(Action.CreateFromConfigString(action));
        }
Example #2
0
        public Keys GetFirstKeyForAction(Action action)
        {
            // sometimes a more convenient version of the above, when labelling GUI elements with their key (usually the GUI can only display one key)
            // this saves checking for empty lists etc
            EnsureKeyLookup();
            string text = action.ToString();

            if (!m_KeyLookup.ContainsKey(text))
            {
                return(Keys.None);
            }
            return(m_KeyLookup[text][0]);
        }
Example #3
0
 public List <Keys> GetKeysForAction(Action action)
 {
     return(GetKeysForAction(action.ToString()));
 }