MyGUI  3.0.1
MyGUI_InputDefine.h
Go to the documentation of this file.
1 
7 /*
8  This file is part of MyGUI.
9 
10  MyGUI is free software: you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  MyGUI is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
22 */
23 #ifndef __MYGUI_INPUT_DEFINE_H__
24 #define __MYGUI_INPUT_DEFINE_H__
25 
26 #include "MyGUI_Prerequest.h"
27 
28 namespace MyGUI
29 {
30 
32  {
33  enum Enum
34  {
35  Left = 0,
38 
39  Button0 = 0,
47 
48  None = -1
49  };
50 
51  MouseButton(Enum _value = None) : value(_value) { }
52 
53  friend bool operator == (MouseButton const& a, MouseButton const& b) { return a.value == b.value; }
54  friend bool operator != (MouseButton const& a, MouseButton const& b) { return a.value != b.value; }
55 
56  int toValue() const { return (int)value; }
57 
58  private:
59  Enum value;
60  };
61 
63  {
64  enum Enum
65  {
66  None = 0x00,
67  Escape = 0x01,
68  One = 0x02,
69  Two = 0x03,
70  Three = 0x04,
71  Four = 0x05,
72  Five = 0x06,
73  Six = 0x07,
74  Seven = 0x08,
75  Eight = 0x09,
76  Nine = 0x0A,
77  Zero = 0x0B,
78  Minus = 0x0C, /* - on main keyboard */
79  Equals = 0x0D,
80  Backspace = 0x0E, /* Backspace */
81  Tab = 0x0F,
82  Q = 0x10,
83  W = 0x11,
84  E = 0x12,
85  R = 0x13,
86  T = 0x14,
87  Y = 0x15,
88  U = 0x16,
89  I = 0x17,
90  O = 0x18,
91  P = 0x19,
92  LeftBracket = 0x1A,
93  RightBracket = 0x1B,
94  Return = 0x1C, /* Enter on main keyboard */
95  LeftControl = 0x1D,
96  A = 0x1E,
97  S = 0x1F,
98  D = 0x20,
99  F = 0x21,
100  G = 0x22,
101  H = 0x23,
102  J = 0x24,
103  K = 0x25,
104  L = 0x26,
105  Semicolon = 0x27,
106  Apostrophe = 0x28,
107  Grave = 0x29, /* Accent grave ( ~ ) */
108  LeftShift = 0x2A,
109  Backslash = 0x2B,
110  Z = 0x2C,
111  X = 0x2D,
112  C = 0x2E,
113  V = 0x2F,
114  B = 0x30,
115  N = 0x31,
116  M = 0x32,
117  Comma = 0x33,
118  Period = 0x34, /* . on main keyboard */
119  Slash = 0x35, /* '/' on main keyboard */
120  RightShift = 0x36,
121  Multiply = 0x37, /* * on numeric keypad */
122  LeftAlt = 0x38, /* Left Alt */
123  Space = 0x39,
124  Capital = 0x3A,
125  F1 = 0x3B,
126  F2 = 0x3C,
127  F3 = 0x3D,
128  F4 = 0x3E,
129  F5 = 0x3F,
130  F6 = 0x40,
131  F7 = 0x41,
132  F8 = 0x42,
133  F9 = 0x43,
134  F10 = 0x44,
135  NumLock = 0x45,
136  ScrollLock = 0x46, /* Scroll Lock */
137  Numpad7 = 0x47,
138  Numpad8 = 0x48,
139  Numpad9 = 0x49,
140  Subtract = 0x4A, /* - on numeric keypad */
141  Numpad4 = 0x4B,
142  Numpad5 = 0x4C,
143  Numpad6 = 0x4D,
144  Add = 0x4E, /* + on numeric keypad */
145  Numpad1 = 0x4F,
146  Numpad2 = 0x50,
147  Numpad3 = 0x51,
148  Numpad0 = 0x52,
149  Decimal = 0x53, /* . on numeric keypad */
150  OEM_102 = 0x56, /* < > | on UK/Germany keyboards */
151  F11 = 0x57,
152  F12 = 0x58,
153  F13 = 0x64, /* (NEC PC98) */
154  F14 = 0x65, /* (NEC PC98) */
155  F15 = 0x66, /* (NEC PC98) */
156  Kana = 0x70, /* (Japanese keyboard) */
157  ABNT_C1 = 0x73, /* / ? on Portugese (Brazilian) keyboards */
158  Convert = 0x79, /* (Japanese keyboard) */
159  NoConvert = 0x7B, /* (Japanese keyboard) */
160  Yen = 0x7D, /* (Japanese keyboard) */
161  ABNT_C2 = 0x7E, /* Numpad . on Portugese (Brazilian) keyboards */
162  NumpadEquals = 0x8D, /* = on numeric keypad (NEC PC98) */
163  PrevTrack = 0x90, /* Previous Track (KC_CIRCUMFLEX on Japanese keyboard) */
164  At = 0x91, /* (NEC PC98) */
165  Colon = 0x92, /* (NEC PC98) */
166  Underline = 0x93, /* (NEC PC98) */
167  Kanji = 0x94, /* (Japanese keyboard) */
168  Stop = 0x95, /* (NEC PC98) */
169  AX = 0x96, /* (Japan AX) */
170  Unlabeled = 0x97, /* (J3100) */
171  NextTrack = 0x99, /* Next Track */
172  NumpadEnter = 0x9C, /* Enter on numeric keypad */
173  RightControl = 0x9D,
174  Mute = 0xA0,
175  Calculator = 0xA1,
176  PlayPause = 0xA2, /* Play / Pause */
177  MediaStop = 0xA4, /* Media Stop */
178  VolumeDown = 0xAE, /* Volume - */
179  VolumeUp = 0xB0, /* Volume + */
180  WebHome = 0xB2, /* Web home */
181  NumpadComma = 0xB3, /* , on numeric keypad (NEC PC98) */
182  Divide = 0xB5, /* / on numeric keypad */
183  SysRq = 0xB7,
184  RightAlt = 0xB8, /* Right Alt */
185  Pause = 0xC5,
186  Home = 0xC7, /* Home on arrow keypad */
187  ArrowUp = 0xC8, /* UpArrow on arrow keypad */
188  PageUp = 0xC9, /* PgUp on arrow keypad */
189  ArrowLeft = 0xCB, /* LeftArrow on arrow keypad */
190  ArrowRight = 0xCD, /* RightArrow on arrow keypad */
191  End = 0xCF, /* End on arrow keypad */
192  ArrowDown = 0xD0, /* DownArrow on arrow keypad */
193  PageDown = 0xD1, /* PgDn on arrow keypad */
194  Insert = 0xD2, /* Insert on arrow keypad */
195  Delete = 0xD3, /* Delete on arrow keypad */
196  LeftWindows = 0xDB, /* Left Windows key */
197  RightWindow = 0xDC, /* Right Windows key */
198  RightWindows = 0xDC, /* Right Windows key - Correct spelling :) */
199  AppMenu = 0xDD, /* AppMenu key */
200  Power = 0xDE, /* System Power */
201  Sleep = 0xDF, /* System Sleep */
202  Wake = 0xE3, /* System Wake */
203  WebSearch = 0xE5,
204  WebFavorites = 0xE6,
205  WebRefresh = 0xE7,
206  WebStop = 0xE8,
207  WebForward = 0xE9,
208  WebBack = 0xEA,
209  MyComputer = 0xEB,
210  Mail = 0xEC,
211  MediaSelect = 0xED
212  };
213 
214  KeyCode(Enum _value = None) : value(_value) { }
215 
216  friend bool operator == (KeyCode const& a, KeyCode const& b) { return a.value == b.value; }
217  friend bool operator != (KeyCode const& a, KeyCode const& b) { return a.value != b.value; }
218 
219  int toValue() const { return (int)value; }
220 
221  private:
222  Enum value;
223  };
224 
225 } // namespace MyGUI
226 
227 #endif // __MYGUI_INPUT_DEFINE_H__