1 /* ncmpc (Ncurses MPD Client)
2 * (c) 2004-2017 The Music Player Daemon Project
3 * Project homepage: http://musicpd.org
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33 #define MAX_COMMAND_KEYS 3
62 CMD_TOGGLE_AUTOCENTER
,
73 CMD_LIST_PREVIOUS_PAGE
,
81 CMD_LIST_RANGE_SELECT
,
82 CMD_LIST_SCROLL_UP_LINE
,
83 CMD_LIST_SCROLL_DOWN_LINE
,
84 CMD_LIST_SCROLL_UP_HALF
,
85 CMD_LIST_SCROLL_DOWN_HALF
,
104 CMD_GO_ROOT_DIRECTORY
,
105 CMD_GO_PARENT_DIRECTORY
,
112 /* command definition flags */
113 #define COMMAND_KEY_MODIFIED 0x01
114 #define COMMAND_KEY_CONFLICT 0x02
117 /* write key bindings flags */
118 #define KEYDEF_WRITE_HEADER 0x01
119 #define KEYDEF_WRITE_ALL 0x02
120 #define KEYDEF_COMMENT_ALL 0x04
123 int keys
[MAX_COMMAND_KEYS
];
127 const char *description
;
128 } command_definition_t
;
130 #ifdef ENABLE_KEYDEF_SCREEN
131 command_definition_t
*get_command_definitions(void);
132 size_t get_cmds_max_name_width(command_definition_t
*cmds
);
137 find_key_command(int key
, const command_definition_t
*cmds
);
139 void command_dump_keys(void);
144 * @return true on success, false on error
147 check_key_bindings(command_definition_t
*cmds
, char *buf
, size_t size
);
150 * @return true on success, false on error
153 write_key_bindings(FILE *f
, int all
);
158 const char *key2str(int key
);
161 const char *get_key_description(command_t command
);
164 const char *get_key_command_name(command_t command
);
167 const char *get_key_names(command_t command
, bool all
);
170 command_t
get_key_command(int key
);
174 get_key_command_from_name(const char *name
);
177 * @return true on success, false on error
180 assign_keys(command_t command
, int keys
[MAX_COMMAND_KEYS
]);