mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-21 23:09:40 +00:00
cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20671 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8279ab9cf0
commit
c4033d4012
@ -20,8 +20,6 @@
|
||||
#include "LyXAction.h"
|
||||
#include "Lexer.h"
|
||||
|
||||
#include "frontends/KeySymbol.h"
|
||||
|
||||
#include "support/filetools.h"
|
||||
|
||||
#include <sstream>
|
||||
@ -36,18 +34,17 @@ using support::FileName;
|
||||
using support::i18nLibFileSearch;
|
||||
|
||||
|
||||
string const KeyMap::printKeySym(KeySymbol const & key,
|
||||
key_modifier::state mod)
|
||||
string const KeyMap::printKeySym(KeySymbol const & key, KeyModifier mod)
|
||||
{
|
||||
string buf;
|
||||
|
||||
string const s = key.getSymbolName();
|
||||
|
||||
if (mod & key_modifier::shift)
|
||||
if (mod & ShiftModifier)
|
||||
buf += "S-";
|
||||
if (mod & key_modifier::ctrl)
|
||||
if (mod & ControlModifier)
|
||||
buf += "C-";
|
||||
if (mod & key_modifier::alt)
|
||||
if (mod & AltModifier)
|
||||
buf += "M-";
|
||||
|
||||
buf += s;
|
||||
@ -171,7 +168,7 @@ bool KeyMap::read(string const & bind_file)
|
||||
|
||||
|
||||
FuncRequest const & KeyMap::lookup(KeySymbol const &key,
|
||||
key_modifier::state mod, KeySequence * seq) const
|
||||
KeyModifier mod, KeySequence * seq) const
|
||||
{
|
||||
static FuncRequest const unknown(LFUN_UNKNOWN_ACTION);
|
||||
|
||||
@ -183,9 +180,8 @@ FuncRequest const & KeyMap::lookup(KeySymbol const &key,
|
||||
|
||||
Table::const_iterator end = table.end();
|
||||
for (Table::const_iterator cit = table.begin(); cit != end; ++cit) {
|
||||
key_modifier::state mask(cit->mod.second);
|
||||
key_modifier::state check =
|
||||
static_cast<key_modifier::state>(mod & ~mask);
|
||||
KeyModifier mask = cit->mod.second;
|
||||
KeyModifier check = static_cast<KeyModifier>(mod & ~mask);
|
||||
|
||||
if (cit->code == key && cit->mod.first == check) {
|
||||
// match found
|
||||
@ -229,8 +225,8 @@ void KeyMap::defkey(KeySequence * seq, FuncRequest const & func, unsigned int r)
|
||||
if (!code.isOK())
|
||||
return;
|
||||
|
||||
key_modifier::state const mod1 = seq->modifiers[r].first;
|
||||
key_modifier::state const mod2 = seq->modifiers[r].second;
|
||||
KeyModifier const mod1 = seq->modifiers[r].first;
|
||||
KeyModifier const mod2 = seq->modifiers[r].second;
|
||||
|
||||
// check if key is already there
|
||||
Table::iterator end = table.end();
|
||||
|
13
src/KeyMap.h
13
src/KeyMap.h
@ -16,7 +16,7 @@
|
||||
|
||||
#include "FuncRequest.h"
|
||||
|
||||
#include "frontends/key_state.h"
|
||||
#include "frontends/KeyModifier.h"
|
||||
#include "frontends/KeySymbol.h"
|
||||
|
||||
#include "support/docstream.h"
|
||||
@ -60,8 +60,7 @@ public:
|
||||
* @return the action / LFUN_COMMAND_PREFIX / LFUN_UNKNOWN_ACTION
|
||||
*/
|
||||
FuncRequest const &
|
||||
lookup(KeySymbol const & key,
|
||||
key_modifier::state mod, KeySequence * seq) const;
|
||||
lookup(KeySymbol const & key, KeyModifier mod, KeySequence * seq) const;
|
||||
|
||||
///
|
||||
typedef std::deque<KeySequence> Bindings;
|
||||
@ -77,7 +76,7 @@ public:
|
||||
* The KeySymbol pointer is 0 is no key is found.
|
||||
* [only used by the Qt/Mac frontend]
|
||||
*/
|
||||
std::pair<KeySymbol, key_modifier::state>
|
||||
std::pair<KeySymbol, KeyModifier>
|
||||
find1keybinding(FuncRequest const & func) const;
|
||||
|
||||
|
||||
@ -87,9 +86,9 @@ public:
|
||||
* @param mod the modifiers
|
||||
*/
|
||||
static std::string const printKeySym(KeySymbol const & key,
|
||||
key_modifier::state mod);
|
||||
KeyModifier mod);
|
||||
|
||||
typedef std::pair<key_modifier::state, key_modifier::state> modifier_pair;
|
||||
typedef std::pair<KeyModifier, KeyModifier> ModifierPair;
|
||||
|
||||
private:
|
||||
///
|
||||
@ -98,7 +97,7 @@ private:
|
||||
KeySymbol code;
|
||||
|
||||
/// Modifier masks
|
||||
modifier_pair mod;
|
||||
ModifierPair mod;
|
||||
|
||||
/// Keymap for prefix keys
|
||||
boost::shared_ptr<KeyMap> table;
|
||||
|
@ -27,7 +27,7 @@ using std::string;
|
||||
namespace lyx {
|
||||
|
||||
FuncRequest const & KeySequence::addkey(KeySymbol const & key,
|
||||
key_modifier::state mod, key_modifier::state nmod)
|
||||
KeyModifier mod, KeyModifier nmod)
|
||||
{
|
||||
// adding a key to a deleted sequence
|
||||
// starts a new sequence
|
||||
@ -55,8 +55,8 @@ size_t KeySequence::parse(string const & s)
|
||||
return 1;
|
||||
|
||||
size_t i = 0;
|
||||
key_modifier::state mod = key_modifier::none;
|
||||
key_modifier::state nmod = key_modifier::none;
|
||||
KeyModifier mod = NoModifier;
|
||||
KeyModifier nmod = NoModifier;
|
||||
|
||||
while (i < s.length()) {
|
||||
if (s[i] == ' ')
|
||||
@ -67,15 +67,15 @@ size_t KeySequence::parse(string const & s)
|
||||
if (i + 1 < s.length() && s[i + 1] == '-') {
|
||||
switch (s[i]) {
|
||||
case 's': case 'S':
|
||||
mod |= key_modifier::shift;
|
||||
mod |= ShiftModifier;
|
||||
i += 2;
|
||||
continue;
|
||||
case 'c': case 'C':
|
||||
mod |= key_modifier::ctrl;
|
||||
mod |= ControlModifier;
|
||||
i += 2;
|
||||
continue;
|
||||
case 'm': case 'M':
|
||||
mod |= key_modifier::alt;
|
||||
mod |= AltModifier;
|
||||
i += 2;
|
||||
continue;
|
||||
default:
|
||||
@ -85,15 +85,15 @@ size_t KeySequence::parse(string const & s)
|
||||
&& s[i + 2] == '-') {
|
||||
switch (s[i + 1]) {
|
||||
case 's': case 'S':
|
||||
nmod |= key_modifier::shift;
|
||||
nmod |= ShiftModifier;
|
||||
i += 3;
|
||||
continue;
|
||||
case 'c': case 'C':
|
||||
nmod |= key_modifier::ctrl;
|
||||
nmod |= ControlModifier;
|
||||
i += 3;
|
||||
continue;
|
||||
case 'm': case 'M':
|
||||
nmod |= key_modifier::alt;
|
||||
nmod |= AltModifier;
|
||||
i += 3;
|
||||
continue;
|
||||
default:
|
||||
@ -114,7 +114,7 @@ size_t KeySequence::parse(string const & s)
|
||||
i = j;
|
||||
|
||||
addkey(key, mod, nmod);
|
||||
mod = key_modifier::none;
|
||||
mod = NoModifier;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,10 +10,10 @@
|
||||
* Full author contact details are available in file CREDITS.
|
||||
*/
|
||||
|
||||
#ifndef KB_SEQUENCE_H
|
||||
#define KB_SEQUENCE_H
|
||||
#ifndef KEYSEQUENCE_H
|
||||
#define KEYSEQUENCE_H
|
||||
|
||||
#include "frontends/key_state.h"
|
||||
#include "frontends/KeyModifier.h"
|
||||
#include "frontends/KeySymbol.h"
|
||||
|
||||
#include <string>
|
||||
@ -45,9 +45,8 @@ public:
|
||||
* @param nmod which modifiers to mask out for equality test
|
||||
* @return the action matching this key sequence or LFUN_UNKNOWN_ACTION
|
||||
*/
|
||||
FuncRequest const &
|
||||
addkey(KeySymbol const & keysym, key_modifier::state mod,
|
||||
key_modifier::state nmod = key_modifier::none);
|
||||
FuncRequest const & addkey(KeySymbol const & keysym, KeyModifier mod,
|
||||
KeyModifier nmod = NoModifier);
|
||||
|
||||
/**
|
||||
* Add a sequence of keys from a string to the sequence
|
||||
@ -105,11 +104,10 @@ private:
|
||||
*/
|
||||
Sequence sequence;
|
||||
|
||||
typedef std::pair<key_modifier::state, key_modifier::state>
|
||||
modifier_pair;
|
||||
typedef std::pair<KeyModifier, KeyModifier> ModifierPair;
|
||||
|
||||
/// modifiers for keys in the sequence
|
||||
std::vector<modifier_pair> modifiers;
|
||||
std::vector<ModifierPair> modifiers;
|
||||
|
||||
/// is keysequence deleted ?
|
||||
bool deleted_;
|
||||
|
@ -202,7 +202,7 @@ Change::Type lookupChangeType(DocIterator const & dit, bool outer = false)
|
||||
|
||||
|
||||
LyXFunc::LyXFunc()
|
||||
: lyx_view_(0), encoded_last_key(0), meta_fake_bit(key_modifier::none)
|
||||
: lyx_view_(0), encoded_last_key(0), meta_fake_bit(NoModifier)
|
||||
{
|
||||
}
|
||||
|
||||
@ -289,8 +289,7 @@ void LyXFunc::gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer)
|
||||
}
|
||||
|
||||
|
||||
void LyXFunc::processKeySym(KeySymbol const & keysym,
|
||||
key_modifier::state state)
|
||||
void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
|
||||
{
|
||||
LYXERR(Debug::KEY) << "KeySym is " << keysym.getSymbolName() << endl;
|
||||
|
||||
@ -323,7 +322,7 @@ void LyXFunc::processKeySym(KeySymbol const & keysym,
|
||||
|
||||
// When not cancel or meta-fake, do the normal lookup.
|
||||
// Note how the meta_fake Mod1 bit is OR-ed in and reset afterwards.
|
||||
// Mostly, meta_fake_bit = key_modifier::none. RVDK_PATCH_5.
|
||||
// Mostly, meta_fake_bit = NoModifier. RVDK_PATCH_5.
|
||||
if ((func.action != LFUN_CANCEL) && (func.action != LFUN_META_PREFIX)) {
|
||||
// remove Caps Lock and Mod2 as a modifiers
|
||||
func = keyseq.addkey(keysym, (state | meta_fake_bit));
|
||||
@ -333,12 +332,11 @@ void LyXFunc::processKeySym(KeySymbol const & keysym,
|
||||
}
|
||||
|
||||
// Dont remove this unless you know what you are doing.
|
||||
meta_fake_bit = key_modifier::none;
|
||||
meta_fake_bit = NoModifier;
|
||||
|
||||
// Can this happen now ?
|
||||
if (func.action == LFUN_NOACTION) {
|
||||
if (func.action == LFUN_NOACTION)
|
||||
func = FuncRequest(LFUN_COMMAND_PREFIX);
|
||||
}
|
||||
|
||||
LYXERR(Debug::KEY) << BOOST_CURRENT_FUNCTION
|
||||
<< " Key [action="
|
||||
@ -350,17 +348,15 @@ void LyXFunc::processKeySym(KeySymbol const & keysym,
|
||||
// why not return already here if action == -1 and
|
||||
// num_bytes == 0? (Lgb)
|
||||
|
||||
if (keyseq.length() > 1) {
|
||||
if (keyseq.length() > 1)
|
||||
lyx_view_->message(keyseq.print(true));
|
||||
}
|
||||
|
||||
|
||||
// Maybe user can only reach the key via holding down shift.
|
||||
// Let's see. But only if shift is the only modifier
|
||||
if (func.action == LFUN_UNKNOWN_ACTION &&
|
||||
state == key_modifier::shift) {
|
||||
if (func.action == LFUN_UNKNOWN_ACTION && state == ShiftModifier) {
|
||||
LYXERR(Debug::KEY) << "Trying without shift" << endl;
|
||||
func = keyseq.addkey(keysym, key_modifier::none);
|
||||
func = keyseq.addkey(keysym, NoModifier);
|
||||
LYXERR(Debug::KEY) << "Action now " << func.action << endl;
|
||||
}
|
||||
|
||||
@ -894,7 +890,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
||||
case LFUN_CANCEL:
|
||||
BOOST_ASSERT(lyx_view_ && lyx_view_->view());
|
||||
keyseq.reset();
|
||||
meta_fake_bit = key_modifier::none;
|
||||
meta_fake_bit = NoModifier;
|
||||
if (lyx_view_->buffer())
|
||||
// cancel any selection
|
||||
dispatch(FuncRequest(LFUN_MARK_OFF));
|
||||
@ -902,18 +898,19 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
||||
break;
|
||||
|
||||
case LFUN_META_PREFIX:
|
||||
meta_fake_bit = key_modifier::alt;
|
||||
meta_fake_bit = AltModifier;
|
||||
setMessage(keyseq.print(true));
|
||||
break;
|
||||
|
||||
case LFUN_BUFFER_TOGGLE_READ_ONLY:
|
||||
case LFUN_BUFFER_TOGGLE_READ_ONLY: {
|
||||
BOOST_ASSERT(lyx_view_ && lyx_view_->view() && lyx_view_->buffer());
|
||||
if (lyx_view_->buffer()->lyxvc().inUse())
|
||||
lyx_view_->buffer()->lyxvc().toggleReadOnly();
|
||||
Buffer * buf = lyx_view_->buffer();
|
||||
if (buf->lyxvc().inUse())
|
||||
buf->lyxvc().toggleReadOnly();
|
||||
else
|
||||
lyx_view_->buffer()->setReadonly(
|
||||
!lyx_view_->buffer()->isReadonly());
|
||||
buf->setReadonly(!lyx_view_->buffer()->isReadonly());
|
||||
break;
|
||||
}
|
||||
|
||||
// --- Menus -----------------------------------------------
|
||||
case LFUN_BUFFER_NEW:
|
||||
@ -2312,7 +2309,7 @@ BufferView * LyXFunc::view() const
|
||||
|
||||
bool LyXFunc::wasMetaKey() const
|
||||
{
|
||||
return (meta_fake_bit != key_modifier::none);
|
||||
return (meta_fake_bit != NoModifier);
|
||||
}
|
||||
|
||||
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
docstring const viewStatusMessage();
|
||||
|
||||
///
|
||||
void processKeySym(KeySymbol const & key, key_modifier::state state);
|
||||
void processKeySym(KeySymbol const & key, KeyModifier state);
|
||||
|
||||
///
|
||||
FuncStatus getStatus(FuncRequest const & action) const;
|
||||
@ -99,7 +99,7 @@ private:
|
||||
///
|
||||
KeySequence cancel_meta_seq;
|
||||
///
|
||||
key_modifier::state meta_fake_bit;
|
||||
KeyModifier meta_fake_bit;
|
||||
|
||||
/// Error status, only Dispatch can change this flag
|
||||
mutable bool errorstat;
|
||||
|
@ -11,37 +11,34 @@
|
||||
* Full author contact details are available in file CREDITS.
|
||||
*/
|
||||
|
||||
#ifndef KEY_STATE_H
|
||||
#define KEY_STATE_H
|
||||
#ifndef KEYMODIFIER_H
|
||||
#define KEYMODIFIER_H
|
||||
|
||||
namespace lyx {
|
||||
|
||||
/// modifier key states
|
||||
namespace key_modifier {
|
||||
|
||||
enum state {
|
||||
none = 0, //< no modifiers held
|
||||
ctrl = 1, //< control button held
|
||||
alt = 2, //< alt/meta key held
|
||||
shift = 4 //< shift key held
|
||||
enum KeyModifier {
|
||||
NoModifier = 0, //< no modifiers held
|
||||
ControlModifier = 1, //< control button held
|
||||
AltModifier = 2, //< alt/meta key held
|
||||
ShiftModifier = 4 //< shift key held
|
||||
};
|
||||
|
||||
|
||||
inline state operator|(state const & s1, state const & s2)
|
||||
inline KeyModifier operator|(KeyModifier s1, KeyModifier s2)
|
||||
{
|
||||
int const i1 = static_cast<int>(s1);
|
||||
int const i2 = static_cast<int>(s2);
|
||||
return static_cast<state>(i1 | i2);
|
||||
return static_cast<KeyModifier>(i1 | i2);
|
||||
}
|
||||
|
||||
|
||||
inline void operator|=(state & s1, state s2)
|
||||
inline void operator|=(KeyModifier & s1, KeyModifier s2)
|
||||
{
|
||||
s1 = static_cast<state>(s1 | s2);
|
||||
s1 = static_cast<KeyModifier>(s1 | s2);
|
||||
}
|
||||
|
||||
} // namespace key_modifier
|
||||
|
||||
|
||||
} // namespace lyx
|
||||
|
@ -12,9 +12,7 @@
|
||||
#ifndef KEYSYMBOL_H
|
||||
#define KEYSYMBOL_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "key_state.h"
|
||||
#include "KeyModifier.h"
|
||||
|
||||
#include "support/docstring.h"
|
||||
|
||||
@ -58,7 +56,7 @@ public:
|
||||
* Use the native UI format when \c forgui is true.
|
||||
* i.e. (translated and with special characters for Mac OS X)
|
||||
*/
|
||||
docstring const print(key_modifier::state mod, bool forgui) const;
|
||||
docstring const print(KeyModifier mod, bool forgui) const;
|
||||
|
||||
///
|
||||
int key() const { return key_; }
|
||||
|
@ -25,6 +25,7 @@ liblyxfrontends_la_SOURCES = \
|
||||
FileDialog.h \
|
||||
FontLoader.h \
|
||||
FontMetrics.h \
|
||||
KeyModifier.h \
|
||||
KeySymbol.h \
|
||||
LyXView.cpp \
|
||||
LyXView.h \
|
||||
@ -37,5 +38,4 @@ liblyxfrontends_la_SOURCES = \
|
||||
WorkArea.h \
|
||||
WorkAreaManager.cpp \
|
||||
WorkAreaManager.h \
|
||||
key_state.h \
|
||||
mouse_state.h
|
||||
|
@ -163,18 +163,18 @@ void WorkArea::redraw()
|
||||
}
|
||||
|
||||
|
||||
void WorkArea::processKeySym(KeySymbol const & key, key_modifier::state state)
|
||||
void WorkArea::processKeySym(KeySymbol const & key, KeyModifier mod)
|
||||
{
|
||||
// In order to avoid bad surprise in the middle of an operation, we better stop
|
||||
// the blinking cursor.
|
||||
stopBlinkingCursor();
|
||||
|
||||
theLyXFunc().setLyXView(lyx_view_);
|
||||
theLyXFunc().processKeySym(key, state);
|
||||
theLyXFunc().processKeySym(key, mod);
|
||||
}
|
||||
|
||||
|
||||
void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k)
|
||||
void WorkArea::dispatch(FuncRequest const & cmd0, KeyModifier mod)
|
||||
{
|
||||
// Handle drag&drop
|
||||
if (cmd0.action == LFUN_FILE_OPEN) {
|
||||
@ -187,9 +187,9 @@ void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k)
|
||||
FuncRequest cmd;
|
||||
|
||||
if (cmd0.action == LFUN_MOUSE_PRESS) {
|
||||
if (k == key_modifier::shift)
|
||||
if (mod == ShiftModifier)
|
||||
cmd = FuncRequest(cmd0, "region-select");
|
||||
else if (k == key_modifier::ctrl)
|
||||
else if (mod == ControlModifier)
|
||||
cmd = FuncRequest(cmd0, "paragraph-select");
|
||||
else
|
||||
cmd = cmd0;
|
||||
|
@ -14,7 +14,7 @@
|
||||
#ifndef BASE_WORKAREA_H
|
||||
#define BASE_WORKAREA_H
|
||||
|
||||
#include "frontends/key_state.h"
|
||||
#include "frontends/KeyModifier.h"
|
||||
#include "frontends/Delegates.h"
|
||||
|
||||
#include "support/Timeout.h"
|
||||
@ -98,7 +98,7 @@ public:
|
||||
|
||||
/// Process Key pressed event.
|
||||
/// This needs to be public because it is accessed externally by GuiView.
|
||||
void processKeySym(KeySymbol const & key, key_modifier::state state);
|
||||
void processKeySym(KeySymbol const & key, KeyModifier mod);
|
||||
|
||||
/// close this work area.
|
||||
/// Slot for Buffer::closing signal.
|
||||
@ -108,8 +108,7 @@ protected:
|
||||
/// cause the display of the given area of the work area
|
||||
virtual void expose(int x, int y, int w, int h) = 0;
|
||||
///
|
||||
void dispatch(FuncRequest const & cmd0,
|
||||
key_modifier::state = key_modifier::none);
|
||||
void dispatch(FuncRequest const & cmd0, KeyModifier = NoModifier);
|
||||
|
||||
///
|
||||
void resizeBufferView();
|
||||
|
@ -10,8 +10,6 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "frontends/KeySymbol.h"
|
||||
|
||||
#include "KeySymbol.h"
|
||||
|
||||
#include "qlkey.h"
|
||||
@ -43,9 +41,7 @@ using lyx::support::contains;
|
||||
using lyx::support::getEnv;
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
char encode(string const & encoding, QString const & str)
|
||||
static char encode(string const & encoding, QString const & str)
|
||||
{
|
||||
typedef map<string, QTextCodec *> EncodingMap;
|
||||
EncodingMap encoding_map;
|
||||
@ -77,8 +73,6 @@ char encode(string const & encoding, QString const & str)
|
||||
return codec->fromUnicode(str).data()[0];
|
||||
}
|
||||
|
||||
} // anon namespace
|
||||
|
||||
|
||||
void setKeySymbol(KeySymbol * sym, QKeyEvent * ev)
|
||||
{
|
||||
@ -152,16 +146,16 @@ char_type KeySymbol::getUCSEncoded() const
|
||||
}
|
||||
|
||||
|
||||
docstring const KeySymbol::print(key_modifier::state mod, bool forgui) const
|
||||
docstring const KeySymbol::print(KeyModifier mod, bool forgui) const
|
||||
{
|
||||
int tmpkey = key_;
|
||||
|
||||
if (mod & key_modifier::shift)
|
||||
tmpkey += Qt::SHIFT;
|
||||
if (mod & key_modifier::ctrl)
|
||||
tmpkey += Qt::CTRL;
|
||||
if (mod & key_modifier::alt)
|
||||
tmpkey += Qt::ALT;
|
||||
if (mod & ShiftModifier)
|
||||
tmpkey += Qt::ShiftModifier;
|
||||
if (mod & ControlModifier)
|
||||
tmpkey += Qt::ControlModifier;
|
||||
if (mod & AltModifier)
|
||||
tmpkey += Qt::AltModifier;
|
||||
|
||||
QKeySequence seq(tmpkey);
|
||||
|
||||
@ -190,15 +184,15 @@ bool KeySymbol::operator==(KeySymbol const & ks) const
|
||||
}
|
||||
|
||||
|
||||
key_modifier::state q_key_state(Qt::KeyboardModifiers state)
|
||||
KeyModifier q_key_state(Qt::KeyboardModifiers state)
|
||||
{
|
||||
key_modifier::state k = key_modifier::none;
|
||||
KeyModifier k = NoModifier;
|
||||
if (state & Qt::ControlModifier)
|
||||
k |= key_modifier::ctrl;
|
||||
k |= ControlModifier;
|
||||
if (state & Qt::ShiftModifier)
|
||||
k |= key_modifier::shift;
|
||||
k |= ShiftModifier;
|
||||
if (state & Qt::AltModifier || state & Qt::MetaModifier)
|
||||
k |= key_modifier::alt;
|
||||
k |= AltModifier;
|
||||
return k;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ namespace lyx {
|
||||
void setKeySymbol(KeySymbol * sym, QKeyEvent * ev);
|
||||
|
||||
/// return the LyX key state from Qt's
|
||||
key_modifier::state q_key_state(Qt::KeyboardModifiers state);
|
||||
KeyModifier q_key_state(Qt::KeyboardModifiers state);
|
||||
|
||||
} // namespace lyx
|
||||
|
||||
|
@ -750,7 +750,7 @@ bool GuiViewBase::event(QEvent * e)
|
||||
if (ke->key() == Qt::Key_Tab || ke->key() == Qt::Key_Backtab) {
|
||||
KeySymbol sym;
|
||||
setKeySymbol(&sym, ke);
|
||||
currentWorkArea()->processKeySym(sym, key_modifier::none);
|
||||
currentWorkArea()->processKeySym(sym, NoModifier);
|
||||
e->accept();
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user