diff options
Diffstat (limited to 'rcm-client-main.c')
-rw-r--r-- | rcm-client-main.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/rcm-client-main.c b/rcm-client-main.c index f7a70c6..ddf5f92 100644 --- a/rcm-client-main.c +++ b/rcm-client-main.c @@ -73,22 +73,23 @@ on_signal(GDBusObjectManagerClient *manager, GVariant *parameters, gpointer user_data) { - bool pressed; + gchar *protocol; + guint64 scancode; gchar *keycode; g_print("Signal %s received for obj %s\n", signal_name, g_dbus_object_get_object_path(G_DBUS_OBJECT(object_proxy))); - if (!strcmp(signal_name, "KeyReleased")) - pressed = false; - else if (!strcmp(signal_name, "KeyPressed")) - pressed = true; - else - return; - - g_variant_get(parameters, "(s)", &keycode); - rcng_client_receive_keypress(G_DBUS_OBJECT(object_proxy), keycode, pressed); - g_free(keycode); + if (!strcmp(signal_name, "KeyReleased")) { + g_variant_get(parameters, "(s)", &keycode); + rcng_client_receive_key_released(G_DBUS_OBJECT(object_proxy), keycode); + g_free(keycode); + } else if (!strcmp(signal_name, "KeyPressed")) { + g_variant_get(parameters, "(sts)", &protocol, &scancode, &keycode); + rcng_client_receive_key_pressed(G_DBUS_OBJECT(object_proxy), protocol, scancode, keycode); + g_free(protocol); + g_free(keycode); + } } static void |