Exemplo n.º 1
0
        protected override void WndProc(ref Message m)
        {
            base.WndProc(ref m);
            if (m.Msg == WM_HOTKEY)
            {
                // Unpack the key and modifier from the lparam.
                Keys     key      = (Keys)(((int)m.LParam >> 16) & 0xFFFF);
                Modifier modifier = (Modifier)((int)m.LParam & 0xFFFF);

                // Find and call the delegate hooked to the modifier/key combo.
                HotkeyCombo combo = new HotkeyCombo((int)modifier, (int)key);
                callbacks[combo](new HotkeyEventArgs(modifier, key));
            }
        }
Exemplo n.º 2
0
 public bool Equals(HotkeyCombo rhs)
 {
     return((modifier == rhs.modifier) && (key == rhs.key));
 }