diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-08-13 18:44:43 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-08-13 18:44:43 +0200 |
commit | 4d76dbf911e866187829e28a57791abaa652519d (patch) | |
tree | 010318d2ad62cb42fc0e0f25cfecdacaa652d736 /src | |
parent | implement protocol for remapping the keyboard (diff) | |
download | mds-4d76dbf911e866187829e28a57791abaa652519d.tar.gz mds-4d76dbf911e866187829e28a57791abaa652519d.tar.bz2 mds-4d76dbf911e866187829e28a57791abaa652519d.tar.xz |
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mds-kkbd.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/mds-kkbd.c b/src/mds-kkbd.c index cb0b3c3..0d72093 100644 --- a/src/mds-kkbd.c +++ b/src/mds-kkbd.c @@ -1006,18 +1006,14 @@ static int remap(char* table, size_t n) */ int handle_keycode_map(const char* recv_action, const char* recv_keyboard) { - int r; + int r = 0; if ((recv_keyboard != NULL) && !strequals(recv_keyboard, KEYBOARD_ID)) return 0; if (recv_action == NULL) - { - eprint("received keycode map request but without any action, ignoring."); - return 0; - } - - if (strequals(recv_action, "remap")) + eprint("received keycode map request but without any action, ignoring."); + else if (strequals(recv_action, "remap")) { if (received.payload_size == 0) { @@ -1028,7 +1024,6 @@ int handle_keycode_map(const char* recv_action, const char* recv_keyboard) with_mutex (mapping_mutex, r = remap(received.payload, received.payload_size); ); - return r; } else if (strequals(recv_action, "reset")) { @@ -1036,14 +1031,14 @@ int handle_keycode_map(const char* recv_action, const char* recv_keyboard) free(mapping); mapping_size = 0; ); - return 0; } else if (strequals(recv_action, "query")) /* FIXME */ { } + else + eprint("received keycode map request with invalid action, ignoring."); - eprint("received keycode map request with invalid action, ignoring."); - return 0; + return r; } |