Mercurial > pidgin
comparison console/libgnt/gntstyle.c @ 14876:70623f0d5cdc
[gaim-migrate @ 17645]
Use terminfo/termcap information (from ncurses) as much as possible. There
still need to be some manual 'refinement' based on $TERM. I'll see if I
can get rid of those. Also, I am probably going to allow users to provide
information that terminfo can't provide, like the keycode for ctrl+up etc.
Let me know if any of the keybinding doesn't work.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 01 Nov 2006 03:38:23 +0000 |
parents | 29c6bec37b96 |
children | 065e7ac30338 |
comparison
equal
deleted
inserted
replaced
14875:7357d46ba817 | 14876:70623f0d5cdc |
---|---|
92 #define SPECIAL_KEY(k, code) do { \ | 92 #define SPECIAL_KEY(k, code) do { \ |
93 if (strncasecmp(key, k, sizeof(k) - 1) == 0) \ | 93 if (strncasecmp(key, k, sizeof(k) - 1) == 0) \ |
94 return g_strdup(code); \ | 94 return g_strdup(code); \ |
95 } while (0) | 95 } while (0) |
96 | 96 |
97 SPECIAL_KEY("home", "\033" GNT_KEY_HOME); | 97 SPECIAL_KEY("home", GNT_KEY_HOME); |
98 SPECIAL_KEY("end", "\033" GNT_KEY_END); | 98 SPECIAL_KEY("end", GNT_KEY_END); |
99 SPECIAL_KEY("pageup", "\033" GNT_KEY_PGUP); | 99 SPECIAL_KEY("pageup", GNT_KEY_PGUP); |
100 SPECIAL_KEY("pagedown", "\033" GNT_KEY_PGDOWN); | 100 SPECIAL_KEY("pagedown", GNT_KEY_PGDOWN); |
101 SPECIAL_KEY("insert", "\033" GNT_KEY_INS); | 101 SPECIAL_KEY("insert", GNT_KEY_INS); |
102 SPECIAL_KEY("delete", "\033" GNT_KEY_DEL); | 102 SPECIAL_KEY("delete", GNT_KEY_DEL); |
103 | 103 |
104 SPECIAL_KEY("left", "\033" GNT_KEY_LEFT); | 104 SPECIAL_KEY("left", GNT_KEY_LEFT); |
105 SPECIAL_KEY("right", "\033" GNT_KEY_RIGHT); | 105 SPECIAL_KEY("right", GNT_KEY_RIGHT); |
106 SPECIAL_KEY("up", "\033" GNT_KEY_UP); | 106 SPECIAL_KEY("up", GNT_KEY_UP); |
107 SPECIAL_KEY("down", "\033" GNT_KEY_DOWN); | 107 SPECIAL_KEY("down", GNT_KEY_DOWN); |
108 | 108 |
109 SPECIAL_KEY("tab", "\t"); | 109 SPECIAL_KEY("tab", "\t"); |
110 SPECIAL_KEY("menu", "\033" GNT_KEY_POPUP); | 110 SPECIAL_KEY("menu", GNT_KEY_POPUP); |
111 | 111 |
112 SPECIAL_KEY("f1", "\033" GNT_KEY_F1); | 112 SPECIAL_KEY("f1", GNT_KEY_F1); |
113 SPECIAL_KEY("f2", "\033" GNT_KEY_F2); | 113 SPECIAL_KEY("f2", GNT_KEY_F2); |
114 SPECIAL_KEY("f3", "\033" GNT_KEY_F3); | 114 SPECIAL_KEY("f3", GNT_KEY_F3); |
115 SPECIAL_KEY("f4", "\033" GNT_KEY_F4); | 115 SPECIAL_KEY("f4", GNT_KEY_F4); |
116 SPECIAL_KEY("f5", "\033" GNT_KEY_F5); | 116 SPECIAL_KEY("f5", GNT_KEY_F5); |
117 SPECIAL_KEY("f6", "\033" GNT_KEY_F6); | 117 SPECIAL_KEY("f6", GNT_KEY_F6); |
118 SPECIAL_KEY("f7", "\033" GNT_KEY_F7); | 118 SPECIAL_KEY("f7", GNT_KEY_F7); |
119 SPECIAL_KEY("f8", "\033" GNT_KEY_F8); | 119 SPECIAL_KEY("f8", GNT_KEY_F8); |
120 SPECIAL_KEY("f9", "\033" GNT_KEY_F9); | 120 SPECIAL_KEY("f9", GNT_KEY_F9); |
121 SPECIAL_KEY("f10", "\033" GNT_KEY_F10); | 121 SPECIAL_KEY("f10", GNT_KEY_F10); |
122 SPECIAL_KEY("f11", "\033" GNT_KEY_F11); | 122 SPECIAL_KEY("f11", GNT_KEY_F11); |
123 SPECIAL_KEY("f12", "\033" GNT_KEY_F12); | 123 SPECIAL_KEY("f12", GNT_KEY_F12); |
124 | 124 |
125 #undef SPECIAL_KEY | 125 #undef SPECIAL_KEY |
126 | 126 |
127 #define MATCH(string, var) do { \ | 127 #define MATCH(string, var) do { \ |
128 if (strncasecmp(key, string, sizeof(string) - 1) == 0) { \ | 128 if (strncasecmp(key, string, sizeof(string) - 1) == 0) { \ |