public void disableAllKeys(eDisableLockSource source)
 {
     for (int i = 0; i < 2; i++)
     {
         eKeyCommand index = (eKeyCommand)i;
         if (!KeyLocks.ContainsKey(index))
         {
             KeyLocks[index] = new List <eDisableLockSource>();
         }
         if (!KeyLocks[index].Contains(source))
         {
             KeyLocks[index].Add(source);
             KeyEnumToClassTranslator[index].primary   = new KeyCodeExtended(KeyCode.None);
             KeyEnumToClassTranslator[index].secondary = new KeyCodeExtended(KeyCode.None);
         }
     }
 }
Exemple #2
0
        public void restoreKey(eKeyCommand index, eDisableLockSource source)
        {
            //Make sure we hold a lock.
            if (!KeyLocks.ContainsKey(index))
            {
                return;
            }
            if (!KeyLocks [index].Contains(source))
            {
                return;
            }

            KeyLocks [index].Remove(source);
            if (KeyLocks [index].Count == 0)
            {
                KeyEnumToClassTranslator [index].primary   = new KeyCodeExtended(KeySaver [index] [0]);
                KeyEnumToClassTranslator [index].secondary = new KeyCodeExtended(KeySaver [index] [1]);
            }
        }
Exemple #3
0
 public void disableKey(eKeyCommand index, eDisableLockSource source)
 {
     if (KeyLocks.ContainsKey(index) && KeyLocks[index].Count > 0)
     {
         //Already locked.
         if (!KeyLocks [index].Contains(source))
         {
             KeyLocks [index].Add(source);
         }
     }
     else
     {
         if (!KeyLocks.ContainsKey(index))
         {
             KeyLocks [index] = new List <eDisableLockSource> ();
         }
         KeyLocks [index].Add(source);
         KeyEnumToClassTranslator [index].primary   = new KeyCodeExtended(KeyCode.None);
         KeyEnumToClassTranslator [index].secondary = new KeyCodeExtended(KeyCode.None);
     }
 }
Exemple #4
0
 public KeyCode[] GetSavedKeyCodes(eKeyCommand index)
 {
     return(KeySaver [index]);
 }