diff options
Diffstat (limited to 'rcm-server-main.c')
-rw-r--r-- | rcm-server-main.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/rcm-server-main.c b/rcm-server-main.c index 3379697..3d8ceee 100644 --- a/rcm-server-main.c +++ b/rcm-server-main.c @@ -155,10 +155,15 @@ method_getkeymap(sd_bus_message *m, void *userdata, sd_bus_error *error) goto out; for (i = 0; i < (keymap->rows * keymap->cols); i++) { - r = sd_bus_message_append(reply, "a{sv}", 3, - "protocol", "s", keymap->layout[i]->protocol, - "scancode", "t", keymap->layout[i]->scancode, - "keycode", "s", keymap->layout[i]->keycode); + if (!keymap->layout[i]) + r = sd_bus_message_append(reply, "a{sv}", 1, + "type", "s", "blank"); + else + r = sd_bus_message_append(reply, "a{sv}", 4, + "type", "s", "button", + "protocol", "s", keymap->layout[i]->protocol, + "scancode", "t", keymap->layout[i]->scancode, + "keycode", "s", keymap->layout[i]->keycode); if (r < 0) goto out; } |