private void OnWndProc(WindowMessageEventArgs args) { if (args.PreventsDefault) { return; } switch (args.uMsg) { case WindowMessageEnum.KEYDOWN: { OnKeyDown((Key)args.wParam); args.ReturnValue = (IntPtr)1; args.PreventDefault(); break; } case WindowMessageEnum.KEYUP: { OnKeyUp((Key)args.wParam); args.ReturnValue = (IntPtr)1; args.PreventDefault(); break; } case WindowMessageEnum.CHAR: { OnKeyPress((Key)args.lParam, (char)args.wParam); args.ReturnValue = (IntPtr)1; args.PreventDefault(); break; } } }
private void OnWndProc(WindowMessageEventArgs args) { if (args.PreventsDefault) { return; } switch (args.uMsg) { case WindowMessageEnum.LBUTTONDOWN: { OnMouseDown((int)MouseButton.Left); args.ReturnValue = (IntPtr)1; args.PreventDefault(); break; } case WindowMessageEnum.LBUTTONUP: { OnMouseUp((int)MouseButton.Left); args.ReturnValue = (IntPtr)1; args.PreventDefault(); break; } case WindowMessageEnum.RBUTTONDOWN: { OnMouseDown((int)MouseButton.Right); args.ReturnValue = (IntPtr)1; args.PreventDefault(); break; } case WindowMessageEnum.RBUTTONUP: { OnMouseUp((int)MouseButton.Right); args.ReturnValue = (IntPtr)1; args.PreventDefault(); break; } case WindowMessageEnum.MBUTTONDOWN: { OnMouseDown((int)MouseButton.Middle); args.ReturnValue = (IntPtr)1; args.PreventDefault(); break; } case WindowMessageEnum.MBUTTONUP: { OnMouseUp((int)MouseButton.Middle); args.ReturnValue = (IntPtr)1; args.PreventDefault(); break; } case WindowMessageEnum.MOUSEWHEEL: { OnMouseWheel(unchecked ((short)(((uint)args.wParam & 0xFFFF0000) >> 16) / 120)); args.ReturnValue = (IntPtr)1; args.PreventDefault(); break; } } }