bool IMessageFilter.PreFilterMessage(ref Message msg) { bool ret = false; switch (msg.Msg) { case WinMessageHelper.WM_KEYDOWN: Keys keyDown = (Keys)msg.WParam.ToInt32(); switch (keyDown) { case Keys.ControlKey: KeyboardHelper.Instance.IsCtrlPressing = true; WinMessageHelper.Instance.PostMessage_MouseMove(this); break; } break; case WinMessageHelper.WM_KEYUP: Keys keyUp = (Keys)msg.WParam.ToInt32() | Control.ModifierKeys; switch (keyUp) { case Keys.Delete: if (SelectedTool != null && SelectedTool.ProcessKeyMsg(keyUp)) { _deleteToolStripMenuItem.PerformClick(); ret = true; } break; case Keys.ControlKey: KeyboardHelper.Instance.IsCtrlPressing = false; WinMessageHelper.Instance.PostMessage_MouseMove(this); break; } break; } return(ret); }