The Button1MotionMask happend MotionNotify,
and Button2MotionMask happend MotionNotify to,
Button3MotionMask,
Button4MotionMask
Button5MotionMask.......
same,there happend ButtonPress and ButtonRelease.
but, i don't know where is mouse left button, where is mouse right button.
my code
Code:
if ((XGrabPointer
(disp, root, False,
Button1MotionMask | ButtonPressMask | ButtonReleaseMask, GrabModeAsync,
GrabModeAsync, root, cursor, CurrentTime) != GrabSuccess))
gib_eprintf("couldn't grab pointer:");
while (1) {
while (!done && XPending(disp)) {
XNextEvent(disp, &ev);
switch (ev.type) {
case MotionNotify://left button select to do something..
case xxxx://left button ButtonPress to do something..
case xxxx://left button ButtonRelease to do something..
[same:-------> right button no select~~]
case xxxx://right button ButtonPress to do something..
a new progremer..
thanks.