BoringHeroes.Interaction.KeyboardHook.Window.WndProc C# (CSharp) Method

WndProc() protected method

Overridden to get the notifications.
protected WndProc ( Message &m ) : void
m System.Windows.Forms.Message
return void
            protected override void WndProc(ref Message m)
            {
                base.WndProc(ref m);

                // check if we got a hot key pressed.
                if (m.Msg == WM_HOTKEY)
                {
                    // get the keys.
                    var key = (Keys) (((int) m.LParam >> 16) & 0xFFFF);
                    var modifier = (ModifierKeys) ((int) m.LParam & 0xFFFF);

                    // invoke the event to notify the parent.
                    if (KeyPressed != null)
                        KeyPressed(this, new KeyPressedEventArgs(modifier, key));
                }
            }
KeyboardHook.Window