Equalizer  2.1.0
Parallel Rendering Framework
eventEnums.h
1 
2 /* Copyright (c) 2014-2017, Daniel Nachbaur <danielnachbaur@gmail.com>
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License version 2.1 as published
6  * by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16  */
17 
18 #ifndef EQFABRIC_EVENTENUMS_H
19 #define EQFABRIC_EVENTENUMS_H
20 
21 #include <iostream>
22 #include <lunchbox/bitOperation.h>
23 #include <lunchbox/types.h>
24 
25 namespace eq
26 {
27 namespace fabric
28 {
29 namespace eventEnums
30 {
36 enum KeyCode
37 {
38  KC_ESCAPE = 256,
39  KC_BACKSPACE,
40  KC_RETURN,
41  KC_TAB,
42  KC_HOME,
43  KC_LEFT,
44  KC_UP,
45  KC_RIGHT,
46  KC_DOWN,
47  KC_PAGE_UP,
48  KC_PAGE_DOWN,
49  KC_END,
50  KC_F1,
51  KC_F2,
52  KC_F3,
53  KC_F4,
54  KC_F5,
55  KC_F6,
56  KC_F7,
57  KC_F8,
58  KC_F9,
59  KC_F10,
60  KC_F11,
61  KC_F12,
62  KC_F13,
63  KC_F14,
64  KC_F15,
65  KC_F16,
66  KC_F17,
67  KC_F18,
68  KC_F19,
69  KC_F20,
70  KC_F21,
71  KC_F22,
72  KC_F23,
73  KC_F24,
74  KC_SHIFT_L,
75  KC_SHIFT_R,
76  KC_CONTROL_L,
77  KC_CONTROL_R,
78  KC_ALT_L,
79  KC_ALT_R,
80  KC_VOID = 0xFFFFFF /* == XK_VoidSymbol */
81 };
82 
88 enum PointerButton
89 {
90  PTR_BUTTON_NONE = LB_BIT_NONE,
91  PTR_BUTTON1 = LB_BIT1,
92  PTR_BUTTON2 = LB_BIT2,
93  PTR_BUTTON3 = LB_BIT3,
94  PTR_BUTTON4 = LB_BIT4,
95  PTR_BUTTON5 = LB_BIT5,
96  PTR_BUTTON6 = LB_BIT6,
97  PTR_BUTTON7 = LB_BIT7
98 };
99 
104 enum class KeyModifier : unsigned
105 {
106  none = LB_BIT_NONE,
107  alt = LB_BIT1,
108  control = LB_BIT2,
109  shift = LB_BIT3,
110  all = LB_BIT1 | LB_BIT2 | LB_BIT3,
111 };
112 
113 inline KeyModifier operator&(const KeyModifier l, const KeyModifier r)
114 {
115  return static_cast<KeyModifier>(static_cast<unsigned>(l) &
116  static_cast<unsigned>(r));
117 }
118 
119 inline KeyModifier operator|(const KeyModifier l, const KeyModifier r)
120 {
121  return static_cast<KeyModifier>(static_cast<unsigned>(l) |
122  static_cast<unsigned>(r));
123 }
124 
125 inline KeyModifier& operator|=(KeyModifier& l, const KeyModifier r)
126 {
127  return l = l | r;
128 }
129 
130 inline std::ostream& operator<<(std::ostream& os, const KeyModifier mod)
131 {
132  if ((mod & KeyModifier::alt) == KeyModifier::alt)
133  os << " alt";
134  if ((mod & KeyModifier::control) == KeyModifier::control)
135  os << " ctrl";
136  if ((mod & KeyModifier::shift) == KeyModifier::shift)
137  os << " shift";
138  return os;
139 }
140 }
141 }
142 }
143 
144 #endif // EQFABRIC_EVENTENUMS_H
The Equalizer client library.
Definition: eq/agl/types.h:23
std::ostream & operator<<(std::ostream &os, const AxisEvent &event)
Print the axis event to the given output stream.
Definition: axisEvent.h:49