Skip to content

Instantly share code, notes, and snippets.

@brandon3055
Last active August 19, 2018 20:25
Show Gist options
  • Save brandon3055/4a41e444960a90f394da35c301b1729f to your computer and use it in GitHub Desktop.
Save brandon3055/4a41e444960a90f394da35c301b1729f to your computer and use it in GitHub Desktop.
void Tests::test() {
disp = XOpenDisplay(NULL);
Window window = XDefaultRootWindow(disp);
// xdo_get_active_window(xdo1, &window); // Gets CLion Window
XSetWindowAttributes attributes;
attributes.event_mask = ExposureMask | KeyPressMask |
StructureNotifyMask | ButtonReleaseMask |
KeyReleaseMask | EnterWindowMask | LeaveWindowMask |
PointerMotionMask | Button1MotionMask | VisibilityChangeMask |
ColormapChangeMask;
attributes.override_redirect = False;
XChangeWindowAttributes(disp, window, CWOverrideRedirect, &attributes);
XEvent xeEvent;
while (True) {
printf("Loop Start.\n");
XNextEvent(disp, &xeEvent);
printf("Event Fired!\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment