mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-23 00:38:01 +00:00
Transfer q_key_state() from GuiWorkArea.cpp to QKeySymbol.cpp. This will also be used later in GuiView.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19562 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
92ee23acb4
commit
550649963c
@ -63,20 +63,6 @@ namespace lyx {
|
|||||||
|
|
||||||
using support::FileName;
|
using support::FileName;
|
||||||
|
|
||||||
/// return the LyX key state from Qt's
|
|
||||||
static key_modifier::state q_key_state(Qt::KeyboardModifiers state)
|
|
||||||
{
|
|
||||||
key_modifier::state k = key_modifier::none;
|
|
||||||
if (state & Qt::ControlModifier)
|
|
||||||
k |= key_modifier::ctrl;
|
|
||||||
if (state & Qt::ShiftModifier)
|
|
||||||
k |= key_modifier::shift;
|
|
||||||
if (state & Qt::AltModifier || state & Qt::MetaModifier)
|
|
||||||
k |= key_modifier::alt;
|
|
||||||
return k;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// return the LyX mouse button state from Qt's
|
/// return the LyX mouse button state from Qt's
|
||||||
static mouse_button::state q_button_state(Qt::MouseButton button)
|
static mouse_button::state q_button_state(Qt::MouseButton button)
|
||||||
{
|
{
|
||||||
|
@ -199,4 +199,16 @@ bool QKeySymbol::operator==(KeySymbol const & ks) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
key_modifier::state q_key_state(Qt::KeyboardModifiers state)
|
||||||
|
{
|
||||||
|
key_modifier::state k = key_modifier::none;
|
||||||
|
if (state & Qt::ControlModifier)
|
||||||
|
k |= key_modifier::ctrl;
|
||||||
|
if (state & Qt::ShiftModifier)
|
||||||
|
k |= key_modifier::shift;
|
||||||
|
if (state & Qt::AltModifier || state & Qt::MetaModifier)
|
||||||
|
k |= key_modifier::alt;
|
||||||
|
return k;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace lyx
|
} // namespace lyx
|
||||||
|
@ -81,6 +81,8 @@ private:
|
|||||||
QString text_;
|
QString text_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// return the LyX key state from Qt's
|
||||||
|
key_modifier::state q_key_state(Qt::KeyboardModifiers state);
|
||||||
|
|
||||||
} // namespace lyx
|
} // namespace lyx
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user