Get fake key events with Xdotool
#include < X11/Xlib.h >
#include < X11/Xutil.h >
#include < stdio.h >
#include < X11/extensions/XTest.h >
void press_button()
{
Display *d;
d = XOpenDisplay(NULL);
if(d == NULL)
{
}
system("xdotool key Shift+a");
XFlush(d);
XCloseDisplay(d);
}
int main() {
press_button();
return 0;
}
source
share