Ich hab mir nun von ein paar HowTos versucht was zusammen zu basteln, aber das KeyEvent funktioniert irgendwie nicht, egal welche Taste ich drücke, es kommt nichts, warum nur?
Code:
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
#include <X11/keysym.h>
int main()
{
Display * dis = XOpenDisplay(0x0);
XEvent report;
XSelectInput (dis, DefaultRootWindow(dis), ExposureMask | KeyPressMask | ButtonPressMask);
while (1)
{
XNextEvent(dis, &report);
switch (report.type)
{
case Expose:
fprintf(stdout, "I have been exposed.\n");
break;
}
}
return 0;
}