4 * Copyright 1995-2002 the LyX Team
5 * Read the file COPYING
7 * \author Lars Gullik Bjønnes <larsbj@lyx.org>
8 * \author John Levon <moz@compsoc.man.ac.uk>
19 #include <boost/smart_ptr.hpp>
25 /// Defines key maps and actions for key sequences
29 * Bind a key sequence to an action.
30 * @return 0 on success, or position in string seq where error
33 string::size_type bind(string const & seq, int action);
35 /// print all available keysyms
36 string const print() const;
39 * Look up a key press in the keymap.
40 * @param key the keysym
41 * @param mod the modifiers
42 * @param seq the current key sequence so far
43 * @return the action / LFUN_PREFIX / LFUN_UNKNOWN_ACTION
45 int lookup(unsigned int key,
46 unsigned int mod, kb_sequence * seq) const;
48 /// Given an action, find all keybindings.
49 string const findbinding(int action,
50 string const & prefix = string()) const;
53 * Returns a string of the given keysym, with modifiers.
55 * @param mod the modifiers
57 static string const printKeysym(unsigned int key, unsigned int mod);
59 /// return the ISO value of a keysym
60 static char getiso(unsigned int i);
71 /// Keymap for prefix keys
72 boost::shared_ptr<kb_keymap> table;
74 /// Action for !prefix keys
80 * Define an action for a key sequence.
81 * @param r internal recursion level
83 void defkey(kb_sequence * seq, int action, unsigned int r = 0);
85 /// Returns a string of the given key
86 string const printKey(kb_key const & key) const;
88 /// is the table empty ?
93 typedef std::list<kb_key> Table;