#include <locale.h>
#include <stdbool.h>
#include <stdlib.h>
+#include <string.h>
#include <xcb/xkb.h>
xkb_keycode_t keycode = event->detail;
tools_print_keycode_state(kbd->state, NULL, keycode,
- XKB_CONSUMED_MODE_XKB);
+ XKB_CONSUMED_MODE_XKB,
+ PRINT_ALL_FIELDS);
/* Exit on ESC. */
- if (keycode == 9)
+ if (xkb_state_key_get_one_sym(kbd->state, keycode) == XKB_KEY_Escape)
terminate = true;
break;
}
struct xkb_context *ctx;
struct keyboard core_kbd;
+ if (argc != 1) {
+ ret = strcmp(argv[1], "--help");
+ fprintf(ret ? stderr : stdout, "Usage: %s [--help]\n", argv[0]);
+ if (ret)
+ fprintf(stderr, "unrecognized option: %s\n", argv[1]);
+ return ret ? EXIT_INVALID_USAGE : EXIT_SUCCESS;
+ }
+
setlocale(LC_ALL, "");
conn = xcb_connect(NULL, NULL);