Ejemplo n.º 1
0
            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.
                    Keys          key      = (Keys)(((int)m.LParam >> 16) & 0xFFFF);
                    _ModifierKeys modifier = (_ModifierKeys)((int)m.LParam & 0xFFFF);

                    // invoke the event to notify the parent.
                    KeyPressed?.Invoke(this, new KeyPressedEventArgs(modifier, key));
                }
            }
Ejemplo n.º 2
0
 internal KeyPressedEventArgs(_ModifierKeys modifier, Keys key)
 {
     Modifier = modifier;
     Key      = key;
 }