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); }
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); }
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))); }
public KCombo(KCode key, KModifier modifier) : this(key) { if (modifier != KModifier.None) { AddModifier(modifier); } }
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); }