Exemple #1
0
 public bool HasModifier(KModifier m)
 {
     if (modifiers == null || modifiers.Length == 0)
     {
         return(false);
     }
     for (int i = 0; i < modifiers.Length; ++i)
     {
         if (modifiers[i].Equals(m))
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #2
0
        public bool AddModifier(KModifier kCode)
        {
            KModifier mod = (KModifier)kCode;             //new Modifier(kCode);

            if (HasModifier(mod))
            {
                return(false);
            }
            List <KModifier> mods = new List <KModifier>();

            if (modifiers != null)
            {
                mods.AddRange(modifiers);
            }
            mods.Add(mod);
            mods.Sort();
            modifiers = mods.ToArray();
            return(true);
        }
Exemple #3
0
 public static void Bind(IList <KBind> KeyBinds, KCode kCode, KModifier modifier, string name, string methodName, object value = null, object target = null)
 {
     KeyBinds.Add(new KBind(new KCombo(kCode, modifier), name, pressFunc: new EventBind(target, methodName, value)));
 }
Exemple #4
0
 public KCombo(KCode key, KModifier modifier) : this(key) {
     if (modifier != KModifier.None)
     {
         AddModifier(modifier);
     }
 }
Exemple #5
0
 public void KeyBind(KCode kCode, KModifier modifier, string name, string methodName, object value = null, object target = null)
 {
     Bind(KeyBinds, kCode, modifier, name, methodName, value, target);
 }