diff options
author | David Härdeman <david@hardeman.nu> | 2015-07-15 19:04:35 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2015-07-15 19:04:35 +0200 |
commit | 35234714a0a51ae7f77cde26a76678d52b7eaeeb (patch) | |
tree | 926eb539bdcbc7ca58272c06c94ada2a288168ba /rcm-client-receive.c | |
parent | 6b7f41a334a46c6149edbde31158bdd549f959a5 (diff) |
Add support for blank "buttons"
Diffstat (limited to 'rcm-client-receive.c')
-rw-r--r-- | rcm-client-receive.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rcm-client-receive.c b/rcm-client-receive.c index f88b453..b12b0c2 100644 --- a/rcm-client-receive.c +++ b/rcm-client-receive.c @@ -399,15 +399,18 @@ void rcng_client_receive_init_ui(GDBusObject *new_hw) gtk_container_set_border_width(GTK_CONTAINER(grid), 12); while (g_variant_iter_loop (&iter, "@a{sv}", &item)) { + gchar *type; gchar *protocol; guint64 scancode; gchar *keycode; + g_variant_lookup(item, "type", "s", &type); g_variant_lookup(item, "protocol", "s", &protocol); g_variant_lookup(item, "scancode", "t", &scancode); g_variant_lookup(item, "keycode", "s", &keycode); - new_button_add(GTK_GRID(grid), protocol, scancode, keycode, NULL, col, row, 1, 1); + if (!strcmp(type, "button")) + new_button_add(GTK_GRID(grid), protocol, scancode, keycode, NULL, col, row, 1, 1); col++; if (col >= km_width) { @@ -415,7 +418,7 @@ void rcng_client_receive_init_ui(GDBusObject *new_hw) row++; } - printf("Got a key: %s:0x%08" PRIx64 ":%s\n", protocol, scancode, keycode); + printf("Got a %s: %s:0x%08" PRIx64 ":%s\n", type, protocol, scancode, keycode); } gtk_widget_show_all(scrollda); |