/// <summary> /// Removes the specified callbacks from the specified key /// </summary> /// <param name="key"></param> /// <param name="callbacks"></param> public void RemoveKeyboardHook(Keys key, HookCallbacks callbacks) { if (_hooks.ContainsKey(key)) { _hooks[key].Remove(callbacks); } }
/// <summary> /// Hooks the specified keypress and call the specified callbacks when keypress occurs /// </summary> /// <param name="key"></param> /// <param name="callbacks"></param> public void SetKeyboardHook(Keys key, HookCallbacks callbacks) { if (!_hooks.ContainsKey(key)) { _hooks.Add(key, new List <HookCallbacks>()); } _hooks[key].Add(callbacks); }