]> git.lyx.org Git - lyx.git/blob - src/frontends/key_state.h
fix tooltips in toolbar
[lyx.git] / src / frontends / key_state.h
1 /**
2  * \file key_state.h
3  * Copyright 2002 the LyX Team
4  * Read the file COPYING
5  *
6  * Keyboard modifier state representation.
7  *
8  * \author John Levon <moz@compsoc.man.ac.uk>
9  */
10
11 #ifndef KEY_STATE_H
12 #define KEY_STATE_H
13
14 /// modifier key states
15 namespace key_modifier { 
16         enum state {
17                 none    = 0, //< no modifiers held
18                 ctrl    = 1, //< control button held
19                 alt     = 2, //< alt/meta key held
20                 shift   = 4  //< shift key held
21         };
22
23  
24 inline state operator|(state const & s1, state const & s2)
25 {
26         int const i1(static_cast<int>(s1));
27         int const i2(static_cast<int>(s2));
28         return static_cast<state>(i1 | i2);
29 }
30
31  
32 inline void operator|=(state & s1, state s2)
33 {
34         s1 = static_cast<state>(s1 | s2);
35 }
36  
37 } // namespace key_modifier
38
39 #endif // KEY_STATE_H