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:
Abdelrazak Younes 2007-08-14 15:00:09 +00:00
parent 92ee23acb4
commit 550649963c
3 changed files with 14 additions and 14 deletions

View File

@ -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)
{ {

View File

@ -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

View File

@ -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