diff options
| author | 2020-03-22 22:34:31 +0100 | |
|---|---|---|
| committer | 2020-03-22 22:34:31 +0100 | |
| commit | a9d4df7da2fa0178ee30730ca7cba913563ee259 (patch) | |
| tree | c45513495f22d8a5280ff5aca273248121690836 | |
| parent | 8cf0497d29dcb22e3a8f222405aa26b93dd1ba19 (diff) | |
| download | xkbcat-a9d4df7da2fa0178ee30730ca7cba913563ee259.tar.gz xkbcat-a9d4df7da2fa0178ee30730ca7cba913563ee259.zip | |
Tidy main loop formatting
| -rw-r--r-- | xkbcat.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -71,17 +71,15 @@ int main(int argc, char * argv[]) { XSync(disp, false); free(m.mask); - while (1) { // Forever + while ("forever") { XEvent event; XGenericEventCookie *cookie = (XGenericEventCookie*)&event.xcookie; XNextEvent(disp, &event); if (XGetEventData(disp, cookie) && cookie->type == GenericEvent && - cookie->extension == xiOpcode) - { - switch (cookie->evtype) - { + cookie->extension == xiOpcode) { + switch (cookie->evtype) { case XI_RawKeyRelease: if (!printKeyUps) continue; case XI_RawKeyPress: { XIRawEvent *ev = cookie->data; @@ -93,7 +91,8 @@ int main(int argc, char * argv[]) { if (NULL == str) continue; - if (printKeyUps) printf("%s", cookie->evtype == XI_RawKeyPress ? "+" : "-"); + if (printKeyUps) printf("%s", + cookie->evtype == XI_RawKeyPress ? "+" : "-"); printf("%s\n", str); break; } |
