mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-08 20:32:49 +00:00
0be0fcfd59
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7598 a592a061-630c-0410-9148-cb99ea01b6c8
43 lines
844 B
C++
43 lines
844 B
C++
// -*- C++ -*-
|
|
/**
|
|
* \file key_state.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* Keyboard modifier state representation.
|
|
*
|
|
* \author John Levon
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef KEY_STATE_H
|
|
#define KEY_STATE_H
|
|
|
|
/// 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
|
|
};
|
|
|
|
|
|
inline state operator|(state const & s1, state const & s2)
|
|
{
|
|
int const i1(static_cast<int>(s1));
|
|
int const i2(static_cast<int>(s2));
|
|
return static_cast<state>(i1 | i2);
|
|
}
|
|
|
|
|
|
inline void operator|=(state & s1, state s2)
|
|
{
|
|
s1 = static_cast<state>(s1 | s2);
|
|
}
|
|
|
|
} // namespace key_modifier
|
|
|
|
#endif // KEY_STATE_H
|