Mat*_*gan 5 c linux x11 xlib mousemove
在XLib中创建窗口时
SetWindowAttributes.event_mask会员提供的口罩是什么?XCreateWindow()XNextEvent(lDisplay, &xEvent);?我找了一个类似的帖子.如果那里已经有一个,请指出我正确的方向.
更新
对于那些想要轻松回答第1-3部分的人:
1.
xAttributes.event_mask = ExposureMask | KeyPressMask | ButtonPress |
StructureNotifyMask | ButtonReleaseMask |
KeyReleaseMask | EnterWindowMask | LeaveWindowMask |
PointerMotionMask | Button1MotionMask | VisibilityChangeMask |
ColormapChangeMask;
Run Code Online (Sandbox Code Playgroud)
2.
unsigned long valuemask = CWEventMask | CWBackPixel | CWBorderPixel | CWCursor;
switch (xEvent.type)
{
case MapNotify:
break;
case Expose:
// If this is not the last expose event break
if (xEvent.xexpose.count != 0)
break;
else
break;
case ConfigureNotify:
break;
case VisibilityNotify:
break;
case DestroyNotify:
break;
case ButtonPress:
case ButtonRelease:
case EnterNotify:
case MotionNotify:
case LeaveNotify:
if(_mouseHandler)
_mouseHandler->HandleInput(lDisplay, &xEvent);
break;
case KeyPress:
case KeyRelease:
if(_keyboardHandler)
_keyboardHandler->HandleInput(lDisplay, &xEvent);
break;
default:
if(_keyboardHandler)
_keyboardHandler->HandleInput(lDisplay, &xEvent);
break;
}
Run Code Online (Sandbox Code Playgroud)