Skip to content

Instantly share code, notes, and snippets.

@yasar11732
Created January 28, 2013 23:08
Show Gist options
  • Save yasar11732/4660141 to your computer and use it in GitHub Desktop.
Save yasar11732/4660141 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/extensions/XInput2.h>
int main() {
/* Connect to the X server */
Display *dpy = XOpenDisplay(NULL);
/* XInput Extension available? */
int opcode, event, error;
if (!XQueryExtension(dpy, "XInputExtension", &opcode, &event, &error)) {
printf("X Input extension not available.\n");
return -1;
}
/* Which version of XI2? We support 2.0 */
int major = 2, minor = 0;
if (XIQueryVersion(dpy, &major, &minor) == BadRequest) {
printf("XI2 not available. Server supports %d.%d\n", major, minor);
return -1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment