diff options
author | Ian Fan <ianfan0@gmail.com> | 2019-01-10 10:55:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-10 10:55:22 +0000 |
commit | 15ac580b28a2906d799fd709e83cb75e0efc3f45 (patch) | |
tree | 9a1f67d98e90d12eb83ffc99b6cac659f8f3f533 /sway/ipc-server.c | |
parent | 058428b8df156d8ed6b93c935dea10cbe51a9619 (diff) | |
parent | eefa6b1ad3f7e6fcbcf52595a833ae28364c18ea (diff) |
Merge pull request #3341 from RedSoxFan/mouse-bindings-improved
Improve mouse button parsing: helpers and bind{code/sym}
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r-- | sway/ipc-server.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 456db866..ff1bc89f 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c @@ -445,8 +445,12 @@ void ipc_event_binding(struct sway_binding *binding) { json_object_object_add(json_binding, "input_code", json_object_new_int(input_code)); json_object_object_add(json_binding, "symbols", symbols); json_object_object_add(json_binding, "symbol", symbol); - json_object_object_add(json_binding, "input_type", binding->type == BINDING_MOUSE ? - json_object_new_string("mouse") : json_object_new_string("keyboard")); + + bool mouse = binding->type == BINDING_MOUSECODE || + binding->type == BINDING_MOUSESYM; + json_object_object_add(json_binding, "input_type", mouse + ? json_object_new_string("mouse") + : json_object_new_string("keyboard")); json_object *json = json_object_new_object(); json_object_object_add(json, "change", json_object_new_string("run")); |