0

我想用鼠标在 DrawingArea 中绘制图像。我可以知道 DrawingArea 中的当前鼠标坐标,但我怎么知道按下的鼠标按钮是什么?我当前的代码如下所示:

            protected void OnPaintedPicture1DrawingareaMotionNotifyEvent (object o, MotionNotifyEventArgs args)
            {
                EventMotion currentEventMotion = (args.Args[0] as EventMotion);

                matchingPercentageForPicture1AndSample1_entry.Text+=String.Format("x='{0}'; y='{1}';\t", currentEventMotion.X, currentEventMotion.Y);
            }
4

2 回答 2

0
BOOL CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
{
  switch(LOWORD(wp))
   {
    case WM_LBUTTONDOWN:

根据我的评论,我发现了这个.. http://www.codeproject.com/Tips/400920/Handling-WM_LBUTTONUP-WM_LBUTTONDOWN-Messages-for

于 2012-12-10T07:51:02.637 回答
0

您可以从中获取有关鼠标按钮(和修饰键)的信息currentEventMotion.State。它包含一个值Gdk.ModifierType

于 2012-12-10T13:03:01.887 回答