Created
January 28, 2013 23:08
-
-
Save yasar11732/4660141 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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