Mercurial > pidgin
annotate finch/libgnt/gntkeys.h @ 17967:c9acdf96e74e
Update login process to more closely match official client.
author | Jeffrey Connelly <jaconnel@calpoly.edu> |
---|---|
date | Sun, 22 Jul 2007 06:53:48 +0000 |
parents | 2c81ebc7bf0b |
children | 8410511f4dbb 05d7fe2320a9 |
rev | line source |
---|---|
15817 | 1 #ifndef GNT_KEYS_H |
2 #define GNT_KEYS_H | |
3 | |
4 #include <curses.h> | |
5 #include <term.h> | |
6 | |
7 /** | |
8 * terminfo/termcap doesn't provide all the information that I want to use, eg. | |
9 * ctrl-up, ctrl-down etc. So I am going to hard-code some of the information | |
10 * for some popular $TERMs | |
11 */ | |
12 extern char *gnt_key_cup; | |
13 extern char *gnt_key_cdown; | |
14 extern char *gnt_key_cleft; | |
15 extern char *gnt_key_cright; | |
16 | |
17 #define SAFE(x) ((x) ? (x) : "") | |
18 | |
19 #define GNT_KEY_POPUP SAFE(key_f16) /* Apparently */ | |
20 | |
21 /* Arrow keys */ | |
22 #define GNT_KEY_LEFT SAFE(key_left) | |
23 #define GNT_KEY_RIGHT SAFE(key_right) | |
24 #define GNT_KEY_UP SAFE(key_up) | |
25 #define GNT_KEY_DOWN SAFE(key_down) | |
26 | |
27 #define GNT_KEY_CTRL_UP SAFE(gnt_key_cup) | |
28 #define GNT_KEY_CTRL_DOWN SAFE(gnt_key_cdown) | |
29 #define GNT_KEY_CTRL_RIGHT SAFE(gnt_key_cright) | |
30 #define GNT_KEY_CTRL_LEFT SAFE(gnt_key_cleft) | |
31 | |
32 #define GNT_KEY_PGUP SAFE(key_ppage) | |
33 #define GNT_KEY_PGDOWN SAFE(key_npage) | |
34 #define GNT_KEY_HOME SAFE(key_home) | |
35 #define GNT_KEY_END SAFE(key_end) | |
36 | |
37 #define GNT_KEY_ENTER carriage_return | |
38 | |
39 #define GNT_KEY_BACKSPACE SAFE(key_backspace) | |
40 #define GNT_KEY_DEL SAFE(key_dc) | |
41 #define GNT_KEY_INS SAFE(key_ic) | |
42 | |
43 #define GNT_KEY_CTRL_A "\001" | |
44 #define GNT_KEY_CTRL_B "\002" | |
45 #define GNT_KEY_CTRL_D "\004" | |
46 #define GNT_KEY_CTRL_E "\005" | |
47 #define GNT_KEY_CTRL_F "\006" | |
48 #define GNT_KEY_CTRL_G "\007" | |
49 #define GNT_KEY_CTRL_H "\010" | |
50 #define GNT_KEY_CTRL_I "\011" | |
51 #define GNT_KEY_CTRL_J "\012" | |
52 #define GNT_KEY_CTRL_K "\013" | |
53 #define GNT_KEY_CTRL_L "\014" | |
54 #define GNT_KEY_CTRL_M "\012" | |
55 #define GNT_KEY_CTRL_N "\016" | |
56 #define GNT_KEY_CTRL_O "\017" | |
57 #define GNT_KEY_CTRL_P "\020" | |
58 #define GNT_KEY_CTRL_R "\022" | |
59 #define GNT_KEY_CTRL_T "\024" | |
60 #define GNT_KEY_CTRL_U "\025" | |
61 #define GNT_KEY_CTRL_V "\026" | |
62 #define GNT_KEY_CTRL_W "\027" | |
63 #define GNT_KEY_CTRL_X "\030" | |
64 #define GNT_KEY_CTRL_Y "\031" | |
65 | |
66 #define GNT_KEY_F1 SAFE(key_f1) | |
67 #define GNT_KEY_F2 SAFE(key_f2) | |
68 #define GNT_KEY_F3 SAFE(key_f3) | |
69 #define GNT_KEY_F4 SAFE(key_f4) | |
70 #define GNT_KEY_F5 SAFE(key_f5) | |
71 #define GNT_KEY_F6 SAFE(key_f6) | |
72 #define GNT_KEY_F7 SAFE(key_f7) | |
73 #define GNT_KEY_F8 SAFE(key_f8) | |
74 #define GNT_KEY_F9 SAFE(key_f9) | |
75 #define GNT_KEY_F10 SAFE(key_f10) | |
76 #define GNT_KEY_F11 SAFE(key_f11) | |
77 #define GNT_KEY_F12 SAFE(key_f12) | |
78 | |
79 /** | |
80 * This will do stuff with the terminal settings and stuff. | |
81 */ | |
82 void gnt_init_keys(void); | |
83 void gnt_keys_refine(char *text); | |
84 const char *gnt_key_translate(const char *name); | |
15979
2c81ebc7bf0b
Add a way to get a list of bindings for a widget. This can be used by, eg, a window-manager to show helpful messages to the user.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
85 const char *gnt_key_lookup(const char *key); |
15817 | 86 |
87 void gnt_keys_add_combination(const char *path); | |
88 void gnt_keys_del_combination(const char *path); | |
89 int gnt_keys_find_combination(const char *path); | |
90 | |
91 | |
92 /* A lot of commonly used variable names are defined in <term.h>. | |
93 * #undef them to make life easier for everyone. */ | |
94 | |
95 #undef columns | |
96 #undef lines | |
97 #undef buttons | |
98 #undef newline | |
99 | |
100 #endif |