#include <sstream>
+using std::endl;
+using std::string;
+
namespace lyx {
using support::FileName;
using support::i18nLibFileSearch;
-using std::endl;
-using std::string;
-
string const KeyMap::printKeySym(KeySymbol const & key,
key_modifier::state mod)
}
-FuncRequest const &
-KeyMap::lookup(KeySymbolPtr key,
+FuncRequest const & KeyMap::lookup(KeySymbol const &key,
key_modifier::state mod, KeySequence * seq) const
{
static FuncRequest const unknown(LFUN_UNKNOWN_ACTION);
key_modifier::state check =
static_cast<key_modifier::state>(mod & ~mask);
- if (*(cit->code) == *key && cit->mod.first == check) {
+ if (cit->code == key && cit->mod.first == check) {
// match found
if (cit->table.get()) {
// this is a prefix key - set new map
docstring buf;
Table::const_iterator end = table.end();
for (Table::const_iterator cit = table.begin(); cit != end; ++cit) {
- buf += cit->code->print(cit->mod.first, forgui);
+ buf += cit->code.print(cit->mod.first, forgui);
buf += ' ';
}
return buf;
void KeyMap::defkey(KeySequence * seq, FuncRequest const & func, unsigned int r)
{
- KeySymbolPtr code = seq->sequence[r];
- if (!code->isOK())
+ KeySymbol code = seq->sequence[r];
+ if (!code.isOK())
return;
key_modifier::state const mod1 = seq->modifiers[r].first;
// check if key is already there
Table::iterator end = table.end();
for (Table::iterator it = table.begin(); it != end; ++it) {
- if (*(code) == *(it->code)
+ if (code == it->code
&& mod1 == it->mod.first
&& mod2 == it->mod.second) {
// overwrite binding
}
-std::pair<KeySymbol const *, key_modifier::state>
-KeyMap::find1keybinding(FuncRequest const & func) const
-{
- Table::const_iterator end = table.end();
- for (Table::const_iterator cit = table.begin();
- cit != end; ++cit) {
- if (!cit->table.get() && cit->func == func)
- return std::make_pair(cit->code.get(), cit->mod.first);
- }
-
- return std::make_pair<KeySymbol const *, key_modifier::state>(0, key_modifier::none);
-}
-
-
} // namespace lyx