1 #ifndef CURSKEY_H_INCLUDED 2 #define CURSKEY_H_INCLUDED 3 4 #include CURSESINC 5 6 /* Additional KEY_ constants */ 7 #define KEY_SPACE ' ' 8 #define KEY_TAB '\t' 9 #define KEY_DEL 127 10 #define KEY_ESCAPE 27 11 #define KEY_INSERT KEY_IC 12 #define KEY_DELETE KEY_DC 13 #define KEY_PAGEUP KEY_PPAGE 14 #define KEY_PAGEDOWN KEY_NPAGE 15 16 /* Modifiers */ 17 #define CURSKEY_MOD_CNTRL 1U 18 #define CURSKEY_MOD_META 2U 19 #define CURSKEY_MOD_ALT CURSKEY_MOD_META 20 21 /* Defines the range of characters which should be "meta-able" */ 22 #define CURSKEY_MAX_META_CHAR 127 23 24 int curskey_init(); 25 void curskey_destroy(); 26 int curskey_define_meta_keys(unsigned int keycode_start); 27 28 int curskey_parse(const char *keydef); 29 int curskey_mod_key(int key, unsigned int modifiers); 30 31 #define curskey_meta_key(KEY) \ 32 curskey_mod_key(KEY, CURSKEY_MOD_META) 33 34 #define curskey_cntrl_key(KEY) \ 35 curskey_mod_key(KEY, CURSKEY_MOD_CNTRL) 36 37 #endif 38