/// <summary> /// Base constructor of <see cref="BaseHookListener"/> /// </summary> /// <param name="hooker">Depending on this parameter the listener hooks either application or global keyboard events.</param> /// <remarks> /// Hooks are not active after instantiation. You need to use either <see cref="BaseHookListener.Enabled"/> property or call <see cref="BaseHookListener.Start"/> method. /// </remarks> protected BaseHookListener(Hooker hooker) { if (hooker == null) { throw new ArgumentNullException("hooker"); } m_Hooker = hooker; }
/// <summary> /// Initializes a new instance of <see cref="MouseHookListener"/>. /// </summary> /// <param name="hooker">Depending on this parameter the listener hooks either application or global mouse events.</param> /// <remarks> /// Hooks are not active after installation. You need to use either <see cref="BaseHookListener.Enabled"/> property or call <see cref="BaseHookListener.Start"/> method. /// </remarks> public MouseHookListener(Hooker hooker) : base(hooker) { m_PreviousPosition = new Point(-1, -1); m_PreviousClickedTime = 0; m_DownButtonsWaitingForMouseUp = MouseButtons.None; m_SuppressButtonUpFlags = MouseButtons.None; m_PreviousClicked = MouseButtons.None; m_SystemDoubleClickTime = MouseNativeMethods.GetDoubleClickTime(); }
///<summary> /// Creates an instance of the HotKeySetsListener, which attaches a Hot Key system to the Hooker selected. ///</summary> ///<param name="hksCollection">A collection of HotKeySets</param> ///<param name="hooker">Depending on this parameter the listener hooks either application or global keyboard events.</param> ///<remarks>Hooks are not active after instantiation. You need to use either <see cref="BaseHookListener.Enabled"/> property or call <see cref="BaseHookListener.Start"/> method.</remarks> public HotKeySetsListener( HotKeySetCollection hksCollection, Hooker hooker ) : base(hooker) { m_hksCollection = hksCollection; }
/// <summary> /// Initializes a new instance of <see cref="KeyboardHookListener"/>. /// </summary> /// <param name="hooker">Depending on this parameter the listener hooks either application or global keyboard events.</param> /// <remarks>Hooks are not active after instantiation. You need to use either <see cref="BaseHookListener.Enabled"/> property or call <see cref="BaseHookListener.Start"/> method.</remarks> public KeyboardHookListener(Hooker hooker) : base(hooker) { }
/// <summary> /// Enables you to switch from application hooks to global hooks and vice versa on the fly /// without unsubscribing from events. Component remains enabled or disabled state after this call as it was before. /// </summary> /// <param name="hooker">An AppHooker or GlobalHooker object.</param> public void Replace(Hooker hooker) { bool rememberEnabled = Enabled; Enabled = false; m_Hooker = hooker; Enabled = rememberEnabled; }