Fix a bug in change_sf()
[cmus.git] / keys.h
blobf947f58a273d48f021d2c395b051be8ebc430d19
1 /*
2 * Copyright 2004-2006 Timo Hirvonen
4 * keys.(c|h) by Frank Terbeck <frank.terbeck@rwth-aachen.de>
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
35 #define NR_CTXS (CTX_QUEUE + 1)
37 struct key {
38 const char *name;
39 int key;
40 uchar ch;
43 struct binding {
44 struct binding *next;
45 const struct key *key;
46 char cmd[0];
49 extern const char * const key_context_names[NR_CTXS + 1];
50 extern const struct key key_table[];
51 extern struct binding *key_bindings[NR_CTXS];
53 void show_binding(const char *context, const char *key);
54 int key_bind(const char *context, const char *key, const char *cmd, int force);
55 int key_unbind(const char *context, const char *key, int force);
57 void normal_mode_ch(uchar ch);
58 void normal_mode_key(int key);
60 #endif