Markus Gutschke wrote:
> You can probably do something with either XSendEvent() or with
> XTestFakeButtonEvent(). If I was going to try doing this, I'd probably
> take a look at the source code for x2x.
Thank you, I shall do that tomorrow.
It seems that i may have jumped the gun when I said my Zoom button was
working.
If I ust Ctrl Alt F1 to switch to a console, and then hit the Zoom
button, I get an error message
"X connection to localhost:0.0 broken (explicit kill or server shutdown)."
and the X server dies.
I wasn't expecting my first X program to work 100%, but am I doing
something fundamentally wrong? (I struggled to find any decent X
programming resources on the web)
TIA
sjb
#include <X11/Xlib.h>
#include <X11/extensions/xf86vmode.h>
#include <stdio.h>
#include <stdlib.h>
int main () {
char mychar;
FILE *file;
if ((file = fopen("/dev/sonypi","r")) == NULL) {
fprintf(stderr, "Unable to open sonypi, %s\n", "file");
exit(1);
}
while (mychar = getc(file)) {
if (mychar == '(') {
Display * pDisplay = XOpenDisplay("localhost:0");
if (pDisplay == NULL) {
fprintf (stderr, "Unable to open display\n");
exit(1);
}
if (XF86VidModeSelectNextMode(pDisplay, 0)) {
}
XCloseDisplay(pDisplay);
}
}
return 0;
}
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert