annotate console/libgnt/gntkeys.h @ 15255:e711afcb9ff4

[gaim-migrate @ 18044] Get rid of a compile warning committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 22 Dec 2006 06:59:05 +0000
parents b28f5caf9445
children c2c2a854f5b3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13850
0e1e59770cb0 [gaim-migrate @ 16308]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
1 #ifndef GNT_KEYS_H
0e1e59770cb0 [gaim-migrate @ 16308]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
2 #define GNT_KEYS_H
0e1e59770cb0 [gaim-migrate @ 16308]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
3
14876
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
4 #include <curses.h>
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
5 #include <term.h>
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
6
14977
1c0772f7260b [gaim-migrate @ 17755]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
7 /**
1c0772f7260b [gaim-migrate @ 17755]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
8 * terminfo/termcap doesn't provide all the information that I want to use, eg.
1c0772f7260b [gaim-migrate @ 17755]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
9 * ctrl-up, ctrl-down etc. So I am going to hard-code some of the information
1c0772f7260b [gaim-migrate @ 17755]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
10 * for some popular $TERMs
1c0772f7260b [gaim-migrate @ 17755]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
11 */
15034
b28f5caf9445 [gaim-migrate @ 17816]
Christopher O'Brien <siege@pidgin.im>
parents: 14977
diff changeset
12 extern char *gnt_key_cup;
b28f5caf9445 [gaim-migrate @ 17816]
Christopher O'Brien <siege@pidgin.im>
parents: 14977
diff changeset
13 extern char *gnt_key_cdown;
b28f5caf9445 [gaim-migrate @ 17816]
Christopher O'Brien <siege@pidgin.im>
parents: 14977
diff changeset
14 extern char *gnt_key_cleft;
b28f5caf9445 [gaim-migrate @ 17816]
Christopher O'Brien <siege@pidgin.im>
parents: 14977
diff changeset
15 extern char *gnt_key_cright;
14977
1c0772f7260b [gaim-migrate @ 17755]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
16
14876
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
17 #define SAFE(x) ((x) ? (x) : "")
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
18
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
19 #define GNT_KEY_POPUP SAFE(key_f16) /* Apparently */
13850
0e1e59770cb0 [gaim-migrate @ 16308]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
20
0e1e59770cb0 [gaim-migrate @ 16308]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
21 /* Arrow keys */
14876
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
22 #define GNT_KEY_LEFT SAFE(key_left)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
23 #define GNT_KEY_RIGHT SAFE(key_right)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
24 #define GNT_KEY_UP SAFE(key_up)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
25 #define GNT_KEY_DOWN SAFE(key_down)
13850
0e1e59770cb0 [gaim-migrate @ 16308]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
26
14977
1c0772f7260b [gaim-migrate @ 17755]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
27 #define GNT_KEY_CTRL_UP SAFE(gnt_key_cup)
1c0772f7260b [gaim-migrate @ 17755]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
28 #define GNT_KEY_CTRL_DOWN SAFE(gnt_key_cdown)
1c0772f7260b [gaim-migrate @ 17755]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
29 #define GNT_KEY_CTRL_RIGHT SAFE(gnt_key_cright)
1c0772f7260b [gaim-migrate @ 17755]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
30 #define GNT_KEY_CTRL_LEFT SAFE(gnt_key_cleft)
14091
ae4cbed1b309 [gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13896
diff changeset
31
14876
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
32 #define GNT_KEY_PGUP SAFE(key_ppage)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
33 #define GNT_KEY_PGDOWN SAFE(key_npage)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
34 #define GNT_KEY_HOME SAFE(key_home)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
35 #define GNT_KEY_END SAFE(key_end)
13896
a621329e8c85 [gaim-migrate @ 16381]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13855
diff changeset
36
14876
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
37 #define GNT_KEY_ENTER carriage_return
13855
5b288502a382 [gaim-migrate @ 16314]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13850
diff changeset
38
14876
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
39 #define GNT_KEY_BACKSPACE SAFE(key_backspace)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
40 #define GNT_KEY_DEL SAFE(key_dc)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
41 #define GNT_KEY_INS SAFE(key_ic)
13850
0e1e59770cb0 [gaim-migrate @ 16308]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
42
14213
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
43 #define GNT_KEY_CTRL_A "\001"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
44 #define GNT_KEY_CTRL_B "\002"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
45 #define GNT_KEY_CTRL_D "\004"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
46 #define GNT_KEY_CTRL_E "\005"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
47 #define GNT_KEY_CTRL_F "\006"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
48 #define GNT_KEY_CTRL_G "\007"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
49 #define GNT_KEY_CTRL_H "\010"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
50 #define GNT_KEY_CTRL_I "\011"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
51 #define GNT_KEY_CTRL_J "\012"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
52 #define GNT_KEY_CTRL_K "\013"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
53 #define GNT_KEY_CTRL_L "\014"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
54 #define GNT_KEY_CTRL_M "\012"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
55 #define GNT_KEY_CTRL_N "\016"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
56 #define GNT_KEY_CTRL_O "\017"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
57 #define GNT_KEY_CTRL_P "\020"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
58 #define GNT_KEY_CTRL_R "\022"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
59 #define GNT_KEY_CTRL_T "\024"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
60 #define GNT_KEY_CTRL_U "\025"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
61 #define GNT_KEY_CTRL_V "\026"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
62 #define GNT_KEY_CTRL_W "\027"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
63 #define GNT_KEY_CTRL_X "\030"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
64 #define GNT_KEY_CTRL_Y "\031"
28269422838f [gaim-migrate @ 16894]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14091
diff changeset
65
14876
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
66 #define GNT_KEY_F1 SAFE(key_f1)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
67 #define GNT_KEY_F2 SAFE(key_f2)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
68 #define GNT_KEY_F3 SAFE(key_f3)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
69 #define GNT_KEY_F4 SAFE(key_f4)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
70 #define GNT_KEY_F5 SAFE(key_f5)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
71 #define GNT_KEY_F6 SAFE(key_f6)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
72 #define GNT_KEY_F7 SAFE(key_f7)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
73 #define GNT_KEY_F8 SAFE(key_f8)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
74 #define GNT_KEY_F9 SAFE(key_f9)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
75 #define GNT_KEY_F10 SAFE(key_f10)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
76 #define GNT_KEY_F11 SAFE(key_f11)
70623f0d5cdc [gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14793
diff changeset
77 #define GNT_KEY_F12 SAFE(key_f12)
14793
8a0cfee11af8 [gaim-migrate @ 17558]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14216
diff changeset
78
14091
ae4cbed1b309 [gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13896
diff changeset
79 /**
ae4cbed1b309 [gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13896
diff changeset
80 * This will do stuff with the terminal settings and stuff.
ae4cbed1b309 [gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13896
diff changeset
81 */
14977
1c0772f7260b [gaim-migrate @ 17755]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
82 void gnt_init_keys();
14091
ae4cbed1b309 [gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13896
diff changeset
83 void gnt_keys_refine(char *text);
ae4cbed1b309 [gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13896
diff changeset
84
14877
c01f62c83647 [gaim-migrate @ 17646]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14876
diff changeset
85
c01f62c83647 [gaim-migrate @ 17646]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14876
diff changeset
86 /* A lot of commonly used variable names are defined in <term.h>.
c01f62c83647 [gaim-migrate @ 17646]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14876
diff changeset
87 * #undef them to make life easier for everyone. */
c01f62c83647 [gaim-migrate @ 17646]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14876
diff changeset
88
c01f62c83647 [gaim-migrate @ 17646]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14876
diff changeset
89 #undef columns
c01f62c83647 [gaim-migrate @ 17646]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14876
diff changeset
90 #undef lines
c01f62c83647 [gaim-migrate @ 17646]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14876
diff changeset
91 #undef buttons
c01f62c83647 [gaim-migrate @ 17646]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14876
diff changeset
92 #undef newline
c01f62c83647 [gaim-migrate @ 17646]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14876
diff changeset
93
13850
0e1e59770cb0 [gaim-migrate @ 16308]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
94 #endif