how can i check mouse clicks in the Linux without using events?
my windows code for doing it is:
bool Mouse::isKeyDown(int key) const{ return ((GetKeyState(key) & 0x80) > 0);}
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
bool Mouse::isKeyDown(int key) const{ return ((GetKeyState(key) & 0x80) > 0);}
Display *display;Window window;bool Mouse::isKeyDown(int key) const{ const unsigned int masks[5] = { Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask }; Window root, child; int root_x, root_y, child_x, child_y; unsigned int mask; if(key < 0 || key >= sizeof(masks)/sizeof(masks[0])) return false; XQueryPointer(display, window, &root, &child, &root_x, &root_y, &child_x, &child_y, &mask); return ((mask & masks[key]) > 0);}