How to make a simple C program which will produce keyboard key hits.
if ( condition ) {
KeyPress('A');
}
I am working on Ubuntu 8.10 Linux OS
Get Fake Key Events by Xdotool
//Compile As: gcc button.c -lX11
#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)
{
//fprintf(stderr, "Errore nell'apertura del Display !!!\n");
//exit(0);
}
system("xdotool key Shift+a");
XFlush(d);
XCloseDisplay(d);
}
int main() {
press_button();
return 0;
}