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