public bool PreFilterMessage(ref Message m) { if (m.Msg == ShortcutEntryForm.WM_KEYDOWN && _handler != null) { Keys keys = (Keys)(int)m.WParam | Control.ModifierKeys; //Keys keys = ((Keys)m.WParam.ToInt32()); Console.WriteLine(keys.ToString()); //This is going to be slow. Oh well. foreach (string command in _handler.AvailableKeyComboCommands) { if (_handler.IsCommandInvoked(command, m.WParam)) { this.txtCommand.Text = command; } } return(true); } return(false); }