Hi,<br>The next simple program tries to subscribe to all keyboard events, and print a short message on all received ones. I expected to see the short message on all keypresses, for example if I press 'a', 'b', ..., '1', '2', ..., or 'F1', 'F2', etc. But this program prints messages only on Alt, Control, Shift, and Windows keys. How can I change the XkbSelectEvents's parameters to be messaged on all keypresses?<br>
<br> XkbSelectEvents(display, XkbUseCoreKbd, XkbAllEventsMask, XkbAllEventsMask);<br><br>THX, Uzlee<br><br><br>===================================================<br> The program<br>
===================================================<br><br><br>#include <stdio.h><br>#include <stdlib.h><br>#include <X11/Xlib.h><br>#include <X11/XKBlib.h><br><br>Display *display;<br>int screen;<br>
int xkblib_event_code;<br><br>int my_error_handler(Display *display, XErrorEvent *e) {<br> char message[255];<br> XGetErrorText(display, e->error_code, message, sizeof(message));<br> fprintf(stderr, "Xlib error [code: %d]: '%s'\n", e->error_code, message);<br>
exit(2);<br> return 0;<br>}<br><br>void event_loop() {<br> XkbEvent event;<br><br> XkbSelectEvents(display, XkbUseCoreKbd, XkbAllEventsMask, XkbAllEventsMask);<br><br> while (True) {<br>
XNextEvent(display, &event.core);<br> fprintf(stderr, "event received\n");<br> }<br>}<br><br>int main(int argc, char *argv[]) {<br> int error_rtrn, reason_rtrn;<br>
<br> display = XkbOpenDisplay(NULL, &xkblib_event_code, &error_rtrn, NULL, NULL, &reason_rtrn);<br> if (!display) {<br> fprintf(stderr, "Cannot open display.\n");<br> exit(1);<br>
}<br> XSetErrorHandler(my_error_handler);<br> screen = DefaultScreen(display);<br><br> event_loop();<br><br> return 0;<br>}<br><br><br>