Mercurial > pidgin.yaz
comparison console/libgnt/gntkeys.h @ 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 | 8a0cfee11af8 |
children | c01f62c83647 |
comparison
equal
deleted
inserted
replaced
14875:7357d46ba817 | 14876:70623f0d5cdc |
---|---|
1 #ifndef GNT_KEYS_H | 1 #ifndef GNT_KEYS_H |
2 #define GNT_KEYS_H | 2 #define GNT_KEYS_H |
3 | 3 |
4 #define GNT_KEY_POPUP "[29~" | 4 #include <curses.h> |
5 #include <term.h> | |
6 | |
7 #define SAFE(x) ((x) ? (x) : "") | |
8 | |
9 #define GNT_KEY_POPUP SAFE(key_f16) /* Apparently */ | |
5 | 10 |
6 /* Arrow keys */ | 11 /* Arrow keys */ |
7 #define GNT_KEY_LEFT "[D" | 12 #define GNT_KEY_LEFT SAFE(key_left) |
8 #define GNT_KEY_RIGHT "[C" | 13 #define GNT_KEY_RIGHT SAFE(key_right) |
9 #define GNT_KEY_UP "[A" | 14 #define GNT_KEY_UP SAFE(key_up) |
10 #define GNT_KEY_DOWN "[B" | 15 #define GNT_KEY_DOWN SAFE(key_down) |
11 | 16 |
12 #define GNT_KEY_CTRL_UP "[1;5A" | 17 #define GNT_KEY_CTRL_UP "[1;5A" |
13 #define GNT_KEY_CTRL_DOWN "[1;5B" | 18 #define GNT_KEY_CTRL_DOWN "[1;5B" |
14 #define GNT_KEY_CTRL_RIGHT "[1;5C" | 19 #define GNT_KEY_CTRL_RIGHT "[1;5C" |
15 #define GNT_KEY_CTRL_LEFT "[1;5D" | 20 #define GNT_KEY_CTRL_LEFT "[1;5D" |
16 | 21 |
17 #define GNT_KEY_PGUP "[5~" | 22 #define GNT_KEY_PGUP SAFE(key_ppage) |
18 #define GNT_KEY_PGDOWN "[6~" | 23 #define GNT_KEY_PGDOWN SAFE(key_npage) |
19 #define GNT_KEY_HOME "[7~" | 24 #define GNT_KEY_HOME SAFE(key_home) |
20 #define GNT_KEY_END "[8~" | 25 #define GNT_KEY_END SAFE(key_end) |
21 | 26 |
22 #define GNT_KEY_ENTER "\r" | 27 #define GNT_KEY_ENTER carriage_return |
23 | 28 |
24 #define GNT_KEY_BACKSPACE "\177" | 29 #define GNT_KEY_BACKSPACE SAFE(key_backspace) |
25 #define GNT_KEY_DEL "[3~" | 30 #define GNT_KEY_DEL SAFE(key_dc) |
26 #define GNT_KEY_INS "[2~" | 31 #define GNT_KEY_INS SAFE(key_ic) |
27 | 32 |
28 #define GNT_KEY_CTRL_A "\001" | 33 #define GNT_KEY_CTRL_A "\001" |
29 #define GNT_KEY_CTRL_B "\002" | 34 #define GNT_KEY_CTRL_B "\002" |
30 #define GNT_KEY_CTRL_D "\004" | 35 #define GNT_KEY_CTRL_D "\004" |
31 #define GNT_KEY_CTRL_E "\005" | 36 #define GNT_KEY_CTRL_E "\005" |
46 #define GNT_KEY_CTRL_V "\026" | 51 #define GNT_KEY_CTRL_V "\026" |
47 #define GNT_KEY_CTRL_W "\027" | 52 #define GNT_KEY_CTRL_W "\027" |
48 #define GNT_KEY_CTRL_X "\030" | 53 #define GNT_KEY_CTRL_X "\030" |
49 #define GNT_KEY_CTRL_Y "\031" | 54 #define GNT_KEY_CTRL_Y "\031" |
50 | 55 |
51 #define GNT_KEY_F1 "[[A" | 56 #define GNT_KEY_F1 SAFE(key_f1) |
52 #define GNT_KEY_F2 "[[B" | 57 #define GNT_KEY_F2 SAFE(key_f2) |
53 #define GNT_KEY_F3 "[[C" | 58 #define GNT_KEY_F3 SAFE(key_f3) |
54 #define GNT_KEY_F4 "[[D" | 59 #define GNT_KEY_F4 SAFE(key_f4) |
55 #define GNT_KEY_F5 "[[E" | 60 #define GNT_KEY_F5 SAFE(key_f5) |
56 #define GNT_KEY_F6 "[17~" | 61 #define GNT_KEY_F6 SAFE(key_f6) |
57 #define GNT_KEY_F7 "[18~" | 62 #define GNT_KEY_F7 SAFE(key_f7) |
58 #define GNT_KEY_F8 "[19~" | 63 #define GNT_KEY_F8 SAFE(key_f8) |
59 #define GNT_KEY_F9 "[20~" | 64 #define GNT_KEY_F9 SAFE(key_f9) |
60 #define GNT_KEY_F10 "[21~" | 65 #define GNT_KEY_F10 SAFE(key_f10) |
61 #define GNT_KEY_F11 "[23~" | 66 #define GNT_KEY_F11 SAFE(key_f11) |
62 #define GNT_KEY_F12 "[24~" | 67 #define GNT_KEY_F12 SAFE(key_f12) |
63 | 68 |
64 /** | 69 /** |
65 * This will do stuff with the terminal settings and stuff. | 70 * This will do stuff with the terminal settings and stuff. |
66 */ | 71 */ |
67 void gnt_keys_refine(char *text); | 72 void gnt_keys_refine(char *text); |