diff options
author | marha <marha@users.sourceforge.net> | 2012-03-23 10:05:55 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-03-23 10:05:55 +0100 |
commit | 0f834b91a4768673833ab4917e87d86c237bb1a6 (patch) | |
tree | 363489504ed4b2d360259b8de4c9e392918e5d02 /xorg-server/hw/dmx/examples/xled.c | |
parent | fc72edebf875378459368c5383d9023730cbca54 (diff) | |
download | vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.gz vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.bz2 vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.zip |
libX11 xserver fontconfig mesa pixman xkbcomp xkeyboard-config git update
23 Mar 2012
Diffstat (limited to 'xorg-server/hw/dmx/examples/xled.c')
-rw-r--r-- | xorg-server/hw/dmx/examples/xled.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/xorg-server/hw/dmx/examples/xled.c b/xorg-server/hw/dmx/examples/xled.c index 270f80511..32e8e3770 100644 --- a/xorg-server/hw/dmx/examples/xled.c +++ b/xorg-server/hw/dmx/examples/xled.c @@ -40,23 +40,26 @@ #include <X11/extensions/XKBstr.h> #include <sys/time.h> -int main(int argc, char **argv) +int +main(int argc, char **argv) { - Display *display = NULL; - int mask = 0; - unsigned i; - XKeyboardState ks; - XKeyboardControl kc; - XkbDescPtr xkb; - int old[32]; + Display *display = NULL; + int mask = 0; + unsigned i; + XKeyboardState ks; + XKeyboardControl kc; + XkbDescPtr xkb; + int old[32]; if (argc == 2 || argc == 3) { if (!(display = XOpenDisplay(argv[1]))) { printf("Cannot open display %s\n", argv[1]); return -1; } - if (argc >= 3) mask = strtol(argv[2], NULL, 0); - } else { + if (argc >= 3) + mask = strtol(argv[2], NULL, 0); + } + else { printf("Usage: %s display [mask]\n", argv[0]); return -1; } @@ -81,14 +84,13 @@ int main(int argc, char **argv) for (i = 0; i < XkbNumIndicators; i++) { if (xkb->indicators->phys_indicators & (1 << i)) { printf("led %d = %d\n", i, xkb->indicators->maps[i].flags); - old[i] = xkb->indicators->maps[i].flags; + old[i] = xkb->indicators->maps[i].flags; xkb->indicators->maps[i].flags = XkbIM_NoAutomatic; } } printf("XkbSetIndicatorMap = %d\n", XkbSetIndicatorMap(display, ~0, xkb)); XkbFreeKeyboard(xkb, 0, True); - if (!(xkb = XkbAllocKeyboard())) { printf("Cannot allocate\n"); return -1; @@ -105,7 +107,7 @@ int main(int argc, char **argv) printf("XGetKeyboardControl = %d\n", XGetKeyboardControl(display, &ks)); printf("old mask = 0x%08lx\n", ks.led_mask); for (i = 0; i < 5; i++) { - kc.led = i + 1; + kc.led = i + 1; kc.led_mode = (mask & (1 << i)) ? LedModeOn : LedModeOff; printf("XChangeKeyboardControl = %d\n", XChangeKeyboardControl(display, KBLed | KBLedMode, &kc)); |