public void Remove(HotkeyBinding binding) { if (!_loaded) { throw new NullReferenceException(Properties.strings.Bindings_not_loaded); } Bindings.Remove(binding); Save(); }
public void UpdateAt(int index, HotkeyBinding binding) { if (!_loaded) { throw new NullReferenceException(Properties.strings.Bindings_not_loaded); } Bindings[index] = binding; Save(); }
public int Add(HotkeyBinding binding) { if (!_loaded) { throw new NullReferenceException(Properties.strings.Bindings_not_loaded); } Bindings.Add(binding); Save(); return(Bindings.IndexOf(binding)); }
public void HotkeyCallback(Message m) { HotkeyBinding triggeredBinding = Program.BindingManager.Get(m.WParam.ToInt32()); /* uint pid; * Win32Helper.GetWindowThreadProcessId(Win32Helper.GetForegroundWindow(), out pid); * Process p = Process.GetProcessById((int)pid); * string processName = p.ProcessName.ToLower(); * * * if (triggeredBinding.Blacklist) * { * foreach (var s in triggeredBinding.ProcessList) * { * string sL = s.ToLower(); * if (sL.EndsWith(".exe")) * { * sL = sL.Remove(sL.Length - 4, 4 ); * } * if (sL == processName) * { * * * return; * } * } * * } else { * bool run = false; * foreach (var s in triggeredBinding.ProcessList) * { * if (s.ToLower() == processName) * { * run = true; * break; * } * * } * if (!run) * return; * }*/ if (triggeredBinding.IsPython) { if (triggeredBinding.CapsActionEnabled && Control.IsKeyLocked(Keys.Capital)) { PythonSend(triggeredBinding.ActionAlternate); } else { PythonSend(triggeredBinding.Action); } } else { if (triggeredBinding.CapsActionEnabled && Control.IsKeyLocked(Keys.Capital)) { Win32.Send(triggeredBinding.ActionAlternate); } else { Win32.Send(triggeredBinding.Action); } } }