X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fkbsequence.C;h=fa93e556b7789fd748adfe51819bc1ec2e762d7e;hb=98c966c64594611e469313314abd1e59524adb4a;hp=db1759489895f069edde5cfcf784c1e6a897b0e2;hpb=8b8741cd5d7e960c5663911f8b69972419f6d37b;p=lyx.git diff --git a/src/kbsequence.C b/src/kbsequence.C index db17594898..fa93e556b7 100644 --- a/src/kbsequence.C +++ b/src/kbsequence.C @@ -2,7 +2,7 @@ * ====================================================== * * LyX, The Document Processor - * + * * Copyright 1995 Matthias Ettrich * Copyright 1995-2001 The LyX Team. * @@ -23,7 +23,12 @@ #include "commandtags.h" #include "debug.h" + +using std::vector; using std::endl; +using std::hex; +using std::dec; + // The only modifiers that we handle. We want to throw away things // like NumLock. @@ -48,7 +53,7 @@ int kb_sequence::addkey(unsigned int key, unsigned int mod, unsigned int nmod) if (curmap) { return curmap->lookup(key, mod, this); } - + return LFUN_UNKNOWN_ACTION; } @@ -65,7 +70,7 @@ string::size_type kb_sequence::parse(string const & s) ++i; if (i >= s.length()) break; - + if (i + 1 < s.length() && s[i + 1] == '-') { switch (s[i]) { case 's': case 'S': @@ -106,7 +111,7 @@ string::size_type kb_sequence::parse(string const & s) string::size_type j = i; for (; j < s.length() && s[j] != ' '; ++j) tbuf += s[j]; // (!!!check bounds :-) - + KeySym key = XStringToKeysym(tbuf.c_str()); if (key == NoSymbol) { lyxerr[Debug::KBMAP] @@ -115,12 +120,12 @@ string::size_type kb_sequence::parse(string const & s) return j; } i = j; - + addkey(key, mod, nmod); mod = 0; } } - + // empty sequence? if (!length_) return 0; @@ -134,10 +139,10 @@ string const kb_sequence::print() const { string buf; - if (deleted_) - return buf; - - for (std::vector::size_type i = 0; i < length_; ++i) { + //if (deleted_) + // return buf; + + for (vector::size_type i = 0; i < length_; ++i) { buf += kb_keymap::printKeysym(sequence[i], modifiers[i] & 0xffff); // append a blank @@ -182,9 +187,9 @@ char kb_sequence::getiso() const unsigned int const c = getsym(); lyxerr[Debug::KBMAP] << "Raw keysym: " - << std::hex << c << std::dec << endl; + << hex << c << dec << endl; lyxerr[Debug::KBMAP] << "byte 3: " - << std::hex << (c & 0xff00) << std::dec + << hex << (c & 0xff00) << dec << endl; return kb_keymap::getiso(c); }