27 #include <cwidget/curses++.h> 51 :ch((wint_t) ERR), function_key(true)
55 key(wint_t _ch,
bool _function_key)
63 return ch < other.
ch || (ch == other.
ch &&
67 bool operator==(
const key &other)
const 89 std::map<std::string, keybinding> keymap;
108 std::wstring
keyname(
const std::string &tag);
120 keybinding
get(std::string tag)
122 std::map<std::string, keybinding>::iterator found=keymap.find(tag);
124 if(found==keymap.end())
127 return found->second;
139 void set(std::string tag, keybinding strokes);
149 void set(std::string tag,
const key &stroke)
152 strokes.push_back(stroke);
163 bool key_matches(
const key &k, std::string tag);
172 key parse_key(std::wstring keystr);
215 #define KEY_CTRL(x) key(((x)&~(64|32)), false) 216 #define KEY_ALT(x) key((0x200 | (x)), false)