Code

screen_keydef: support adding keys with CMD_ADD
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Wed, 28 Dec 2011 22:18:51 +0000 (23:18 +0100)
committerJonathan Neuschäfer <j.neuschaefer@gmx.net>
Wed, 4 Jan 2012 18:01:46 +0000 (19:01 +0100)
src/screen_help.c
src/screen_keydef.c

index aad266bf820b4646a5a0fced6a98745960cda45e..e0e705b9697b1cd57065bd1b02398518f315d127 100644 (file)
@@ -180,6 +180,7 @@ static const struct help_text_row help_text[] = {
        { 2, CMD_NONE, NULL },
        { 0, CMD_PLAY, N_("Edit keydefs for selected command") },
        { 0, CMD_DELETE, N_("Remove selected keydef") },
+       { 0, CMD_ADD, N_("Add a keydef") },
        { 0, CMD_GO_PARENT_DIRECTORY, N_("Go up a level") },
        { 0, CMD_SAVE_PLAYLIST, N_("Apply and save changes") },
 #endif
index f31e6c5542c09a554486e128c6687e56eee7f1cb..0d7cb72b7a503b992802bd0c8bd1cfbe9a69c91b 100644 (file)
@@ -433,6 +433,10 @@ keydef_cmd(G_GNUC_UNUSED struct mpdclient *c, command_t cmd)
                        delete_key(subcmd, subcmd_item_to_key_id(lw->selected));
 
                return true;
+       case CMD_ADD:
+               if (subcmd != -1)
+                       add_key(subcmd);
+               return true;
        case CMD_SAVE_PLAYLIST:
                apply_keys();
                save_keys();