~ubuntu-branches/ubuntu/vivid/mygui/vivid

« back to all changes in this revision

Viewing changes to MyGUIEngine/include/MyGUI_KeyCode.h

  • Committer: Package Import Robot
  • Author(s): Scott Howard, Bret Curtis, Scott Howard
  • Date: 2014-09-18 17:57:48 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140918175748-dd8va78mvpw1jbes
Tags: 3.2.1-1
[ Bret Curtis ]
* Updated license for majority of files from LGPL to Expat (MIT)

[ Scott Howard ]
* New upstream release
* Updated patch to add build option for system GLEW libraries
* All patches accepted upstream except shared_libraries.patch
* Bumped SONAME due to dropped symbols, updated *.symbols and package
  names
* Updated license of debian/* to Expat with permission of all authors
* Don't install Doxygen autogenerated md5 and map files (thanks
  lintian)

Show diffs side-by-side

added added

removed removed

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