diff --git a/src/command.c b/src/command.c
index 85e499a00873ad2c985dbfbb1241c26b7b1006f2..5621b165650b34fd2197b846755ee3c3967ef242 100644 (file)
--- a/src/command.c
+++ b/src/command.c
#include <signal.h>
#include <unistd.h>
-#undef DEBUG_KEYS
-
-#ifdef DEBUG_KEYS
-#define DK(x) x
-#else
-#define DK(x)
-#endif
-
#define KEY_CTL(x) ((x) & 0x1f) /* KEY_CTL(A) == ^A == \1 */
#define BS KEY_BACKSPACE
#define F6 KEY_F(6)
#define F7 KEY_F(7)
#define F8 KEY_F(8)
+#define F9 KEY_F(9)
#define C(x) KEY_CTL(x)
static command_definition_t cmds[] = {
{ { '1', F1, 'h' }, 0, CMD_SCREEN_HELP, "screen-help",
N_("Help screen") },
{ { '2', F2, 0 }, 0, CMD_SCREEN_PLAY, "screen-playlist",
- N_("Playlist screen") },
+ N_("Queue screen") },
{ { '3', F3, 0 }, 0, CMD_SCREEN_FILE, "screen-browse",
N_("Browse screen") },
{ { '-', LEFT, 0 }, 0, CMD_VOLUME_DOWN, "volume-down",
N_("Decrease volume") },
{ { ' ', 0, 0 }, 0, CMD_SELECT, "select",
- N_("Select/deselect song in playlist") },
+ N_("Select/deselect song in queue") },
{ { 't', 0, 0 }, 0, CMD_SELECT_ALL, "select_all",
N_("Select all listed items") },
{ { DEL, 'd', 0 }, 0, CMD_DELETE, "delete",
- N_("Delete song from playlist") },
+ N_("Delete song from queue") },
{ { 'Z', 0, 0 }, 0, CMD_SHUFFLE, "shuffle",
- N_("Shuffle playlist") },
+ N_("Shuffle queue") },
{ { 'c', 0, 0 }, 0, CMD_CLEAR, "clear",
- N_("Clear playlist") },
+ N_("Clear queue") },
{ { 'r', 0, 0 }, 0, CMD_REPEAT, "repeat",
N_("Toggle repeat mode") },
{ { 'z', 0, 0 }, 0, CMD_RANDOM, "random",
{ { C('U'), 0, 0 }, 0, CMD_DB_UPDATE, "db-update",
N_("Start a music database update") },
{ { 'S', 0, 0 }, 0, CMD_SAVE_PLAYLIST, "save",
- N_("Save playlist") },
+ N_("Save queue") },
{ { 'a', 0, 0 }, 0, CMD_ADD, "add",
- N_("Add url/file to playlist") },
+ N_("Add url/file to queue") },
{ { '!', 0, 0 }, 0, CMD_GO_ROOT_DIRECTORY, "go-root-directory",
N_("Go to root directory") },
N_("Outputs screen") },
#endif
+#ifdef ENABLE_CHAT_SCREEN
+ { {'9', F9, 0}, 0, CMD_SCREEN_CHAT, "screen-chat",
+ N_("Chat screen") },
+#endif
{ { -1, -1, -1 }, 0, CMD_NONE, NULL, NULL }
};
}
command_t
-get_key_command_from_name(char *name)
+get_key_command_from_name(const char *name)
{
for (int i = 0; cmds[i].name; i++)
if (strcmp(name, cmds[i].name) == 0)
}
command_t
-find_key_command(int key, command_definition_t *c)
+find_key_command(int key, const command_definition_t *c)
{
assert(key != 0);
assert(c != NULL);
int key;
key = wgetch(stdscr);
- if (key == ERR)
+ if (key == ERR || key == '\0')
return CMD_NONE;
#ifdef HAVE_GETMOUSE