我想用鼠标在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);
}发布于 2012-12-10 21:03:02
可以从currentEventMotion.State获取有关鼠标按钮(和修改器关键点)的信息。它包含一个值Gdk.ModifierType。
发布于 2012-12-10 15:51:03
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
https://stackoverflow.com/questions/13796833
复制相似问题