2 /* ======================================================================= *\
3 File : kbmap.h, kbmap.h,v 1.3 1996/12/10 04:35:57 larsbj Exp
4 Author : chb, 30.Oct.1995
6 Purpose: class definitions for XKeyEvent keymap handling
7 \* ==================================================================== */
17 #include <boost/smart_ptr.hpp>
23 /// Defines key maps and actions for key sequences
26 /** Bind a key-sequence to an action.
27 Returns 0 on success. Otherwise, position in string where
29 int bind(string const & seq, int action);
32 void print(string & buf) const;
34 /// Look up a key in the keymap
35 int lookup(unsigned int key,
36 unsigned int mod, kb_sequence * seq) const;
38 /// Given an action, find all keybindings.
39 string const findbinding(int action,
40 string const & prefix = string()) const;
50 /// Keymap for prefix keys
51 boost::shared_ptr<kb_keymap> table;
53 /// Action for !prefix keys
58 /// Define a new key sequence
59 int defkey(kb_sequence * seq, int action, int idx = 0);
61 static string const keyname(kb_key const & k);
65 void printKey(kb_key const & key, string & buf);
71 typedef std::list<kb_key> Table;