|
|
@ -298,8 +298,10 @@ void ipc_client_handle_command(struct ipc_client *client) {
|
|
|
|
client->subscribed_events |= IPC_EVENT_MODE;
|
|
|
|
client->subscribed_events |= IPC_EVENT_MODE;
|
|
|
|
} else if (strcmp(event_type, "modifier") == 0) {
|
|
|
|
} else if (strcmp(event_type, "modifier") == 0) {
|
|
|
|
client->subscribed_events |= IPC_EVENT_MODIFIER;
|
|
|
|
client->subscribed_events |= IPC_EVENT_MODIFIER;
|
|
|
|
|
|
|
|
#if SWAY_BINDING_EVENT
|
|
|
|
} else if (strcmp(event_type, "binding") == 0) {
|
|
|
|
} else if (strcmp(event_type, "binding") == 0) {
|
|
|
|
client->subscribed_events |= IPC_EVENT_BINDING;
|
|
|
|
client->subscribed_events |= IPC_EVENT_BINDING;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ipc_send_reply(client, "{\"success\": false}", 18);
|
|
|
|
ipc_send_reply(client, "{\"success\": false}", 18);
|
|
|
|
ipc_client_disconnect(client);
|
|
|
|
ipc_client_disconnect(client);
|
|
|
@ -636,6 +638,7 @@ void ipc_event_modifier(uint32_t modifier, const char *state) {
|
|
|
|
json_object_put(obj); // free
|
|
|
|
json_object_put(obj); // free
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if SWAY_BINDING_EVENT
|
|
|
|
static void ipc_event_binding(json_object *sb_obj) {
|
|
|
|
static void ipc_event_binding(json_object *sb_obj) {
|
|
|
|
json_object *obj = json_object_new_object();
|
|
|
|
json_object *obj = json_object_new_object();
|
|
|
|
json_object_object_add(obj, "change", json_object_new_string("run"));
|
|
|
|
json_object_object_add(obj, "change", json_object_new_string("run"));
|
|
|
@ -646,8 +649,10 @@ static void ipc_event_binding(json_object *sb_obj) {
|
|
|
|
|
|
|
|
|
|
|
|
json_object_put(obj); // free
|
|
|
|
json_object_put(obj); // free
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
void ipc_event_binding_keyboard(struct sway_binding *sb) {
|
|
|
|
void ipc_event_binding_keyboard(struct sway_binding *sb) {
|
|
|
|
|
|
|
|
#if SWAY_BINDING_EVENT
|
|
|
|
json_object *sb_obj = json_object_new_object();
|
|
|
|
json_object *sb_obj = json_object_new_object();
|
|
|
|
json_object_object_add(sb_obj, "command", json_object_new_string(sb->command));
|
|
|
|
json_object_object_add(sb_obj, "command", json_object_new_string(sb->command));
|
|
|
|
|
|
|
|
|
|
|
@ -679,4 +684,5 @@ void ipc_event_binding_keyboard(struct sway_binding *sb) {
|
|
|
|
json_object_object_add(sb_obj, "input_type", json_object_new_string("keyboard"));
|
|
|
|
json_object_object_add(sb_obj, "input_type", json_object_new_string("keyboard"));
|
|
|
|
|
|
|
|
|
|
|
|
ipc_event_binding(sb_obj);
|
|
|
|
ipc_event_binding(sb_obj);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|