Handle streams separately in tree_add_track()
[cmus.git] / keys.h
blobb7782dd7a4f34ddd0001aca3b21c8bd4feaeaff3
1 /*
2 * Copyright 2004-2006 Timo Hirvonen
4 * keys.[ch] by Frank Terbeck <ft@bewatermyfriend.org>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 * 02111-1307, USA.
22 #ifndef KEYS_H
23 #define KEYS_H
25 #include "uchar.h"
27 enum key_context {
28 CTX_BROWSER,
29 CTX_COMMON,
30 CTX_FILTERS,
31 CTX_LIBRARY,
32 CTX_PLAYLIST,
33 CTX_QUEUE,
34 CTX_SETTINGS,
36 #define NR_CTXS (CTX_SETTINGS + 1)
38 struct key {
39 const char *name;
40 int key;
41 uchar ch;
44 struct binding {
45 struct binding *next;
46 const struct key *key;
47 enum key_context ctx;
48 char cmd[0];
51 extern const char * const key_context_names[NR_CTXS + 1];
52 extern const struct key key_table[];
53 extern struct binding *key_bindings[NR_CTXS];
55 void show_binding(const char *context, const char *key);
56 int key_bind(const char *context, const char *key, const char *cmd, int force);
57 int key_unbind(const char *context, const char *key, int force);
59 void normal_mode_ch(uchar ch);
60 void normal_mode_key(int key);
62 #endif