/// <summary>
        /// This method processes the data from the hook and initiates event firing.
        /// </summary>
        /// <param name="wParam">The first Windows Messages parameter.</param>
        /// <param name="lParam">The second Windows Messages parameter.</param>
        /// <returns>
        /// True - The hook will be passed along to other applications.
        /// <para>
        /// False - The hook will not be given to other applications, effectively blocking input.
        /// </para>
        /// </returns>
        protected override bool ProcessCallback(int wParam, IntPtr lParam)
        {
            KeyEventArgsExt e = KeyEventArgsExt.FromRawData(wParam, lParam, IsGlobal);

            InvokeKeyDown(e);
            InvokeKeyPress(wParam, lParam);
            InvokeKeyUp(e);

            return(!e.Handled);
        }
        private void InvokeKeyDown(KeyEventArgsExt e)
        {
            KeyEventHandler handler = KeyDown;

            if (handler == null || e.Handled || !e.IsKeyDown)
            {
                return;
            }
            handler(this, e);
        }
 private void InvokeKeyUp(KeyEventArgsExt e)
 {
     KeyEventHandler handler = KeyUp;
     if (handler == null || e.Handled || !e.IsKeyUp) { return; }
     handler(this, e);
 }