MyGUI_KeyCode.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_KEY_CODE_H_
#define MYGUI_KEY_CODE_H_
#include "MyGUI_Prerequest.h"
namespace MyGUI
{
struct MYGUI_EXPORT KeyCode
{
enum Enum
{
None = 0x00,
Escape = 0x01,
One = 0x02,
Two = 0x03,
Three = 0x04,
Four = 0x05,
Five = 0x06,
Six = 0x07,
Seven = 0x08,
Eight = 0x09,
Nine = 0x0A,
Zero = 0x0B,
Minus = 0x0C, /* - on main keyboard */
Equals = 0x0D,
Backspace = 0x0E, /* Backspace */
Tab = 0x0F,
Q = 0x10,
W = 0x11,
E = 0x12,
R = 0x13,
T = 0x14,
Y = 0x15,
U = 0x16,
I = 0x17,
O = 0x18,
P = 0x19,
LeftBracket = 0x1A,
RightBracket = 0x1B,
Return = 0x1C, /* Enter on main keyboard */
LeftControl = 0x1D,
A = 0x1E,
S = 0x1F,
D = 0x20,
F = 0x21,
G = 0x22,
H = 0x23,
J = 0x24,
K = 0x25,
L = 0x26,
Semicolon = 0x27,
Apostrophe = 0x28,
Grave = 0x29, /* Accent grave ( ~ ) */
LeftShift = 0x2A,
Backslash = 0x2B,
Z = 0x2C,
X = 0x2D,
C = 0x2E,
V = 0x2F,
B = 0x30,
N = 0x31,
M = 0x32,
Comma = 0x33,
Period = 0x34, /* . on main keyboard */
Slash = 0x35, /* '/' on main keyboard */
RightShift = 0x36,
Multiply = 0x37, /* * on numeric keypad */
LeftAlt = 0x38, /* Left Alt */
Space = 0x39,
Capital = 0x3A,
F1 = 0x3B,
F2 = 0x3C,
F3 = 0x3D,
F4 = 0x3E,
F5 = 0x3F,
F6 = 0x40,
F7 = 0x41,
F8 = 0x42,
F9 = 0x43,
F10 = 0x44,
NumLock = 0x45,
ScrollLock = 0x46, /* Scroll Lock */
Numpad7 = 0x47,
Numpad8 = 0x48,
Numpad9 = 0x49,
Subtract = 0x4A, /* - on numeric keypad */
Numpad4 = 0x4B,
Numpad5 = 0x4C,
Numpad6 = 0x4D,
Add = 0x4E, /* + on numeric keypad */
Numpad1 = 0x4F,
Numpad2 = 0x50,
Numpad3 = 0x51,
Numpad0 = 0x52,
Decimal = 0x53, /* . on numeric keypad */
OEM_102 = 0x56, /* < > | on UK/Germany keyboards */
F11 = 0x57,
F12 = 0x58,
F13 = 0x64, /* (NEC PC98) */
F14 = 0x65, /* (NEC PC98) */
F15 = 0x66, /* (NEC PC98) */
Kana = 0x70, /* (Japanese keyboard) */
ABNT_C1 = 0x73, /* / ? on Portugese (Brazilian) keyboards */
Convert = 0x79, /* (Japanese keyboard) */
NoConvert = 0x7B, /* (Japanese keyboard) */
Yen = 0x7D, /* (Japanese keyboard) */
ABNT_C2 = 0x7E, /* Numpad . on Portugese (Brazilian) keyboards */
NumpadEquals = 0x8D, /* = on numeric keypad (NEC PC98) */
PrevTrack = 0x90, /* Previous Track (KC_CIRCUMFLEX on Japanese keyboard) */
At = 0x91, /* (NEC PC98) */
Colon = 0x92, /* (NEC PC98) */
Underline = 0x93, /* (NEC PC98) */
Kanji = 0x94, /* (Japanese keyboard) */
Stop = 0x95, /* (NEC PC98) */
AX = 0x96, /* (Japan AX) */
Unlabeled = 0x97, /* (J3100) */
NextTrack = 0x99, /* Next Track */
NumpadEnter = 0x9C, /* Enter on numeric keypad */
RightControl = 0x9D,
Mute = 0xA0,
Calculator = 0xA1,
PlayPause = 0xA2, /* Play / Pause */
MediaStop = 0xA4, /* Media Stop */
VolumeDown = 0xAE, /* Volume - */
VolumeUp = 0xB0, /* Volume + */
WebHome = 0xB2, /* Web home */
NumpadComma = 0xB3, /* , on numeric keypad (NEC PC98) */
Divide = 0xB5, /* / on numeric keypad */
SysRq = 0xB7,
RightAlt = 0xB8, /* Right Alt */
Pause = 0xC5,
Home = 0xC7, /* Home on arrow keypad */
ArrowUp = 0xC8, /* UpArrow on arrow keypad */
PageUp = 0xC9, /* PgUp on arrow keypad */
ArrowLeft = 0xCB, /* LeftArrow on arrow keypad */
ArrowRight = 0xCD, /* RightArrow on arrow keypad */
End = 0xCF, /* End on arrow keypad */
ArrowDown = 0xD0, /* DownArrow on arrow keypad */
PageDown = 0xD1, /* PgDn on arrow keypad */
Insert = 0xD2, /* Insert on arrow keypad */
Delete = 0xD3, /* Delete on arrow keypad */
LeftWindows = 0xDB, /* Left Windows key */
RightWindow = 0xDC, /* Right Windows key */
RightWindows = 0xDC, /* Right Windows key - Correct spelling :) */
AppMenu = 0xDD, /* AppMenu key */
Power = 0xDE, /* System Power */
Sleep = 0xDF, /* System Sleep */
Wake = 0xE3, /* System Wake */
WebSearch = 0xE5,
WebFavorites = 0xE6,
WebRefresh = 0xE7,
WebStop = 0xE8,
WebForward = 0xE9,
WebBack = 0xEA,
MyComputer = 0xEB,
Mail = 0xEC,
MediaSelect = 0xED
};
KeyCode(Enum _value = None) :
mValue(_value)
{
}
friend bool operator<(KeyCode const& a, KeyCode const& b)
{
return (a.mValue < b.mValue);
}
friend bool operator>=(KeyCode const& a, KeyCode const& b)
{
return !(a < b);
}
friend bool operator>(KeyCode const& a, KeyCode const& b)
{
return (b < a);
}
friend bool operator<=(KeyCode const& a, KeyCode const& b)
{
return !(a > b);
}
friend bool operator==(KeyCode const& a, KeyCode const& b)
{
return !(a < b) && !(a > b);
}
friend bool operator!=(KeyCode const& a, KeyCode const& b)
{
return !(a == b);
}
int getValue() const
{
return mValue;
}
private:
Enum mValue;
};
} // namespace MyGUI
#endif // MYGUI_KEY_CODE_H_
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::KeyCode::operator>=
friend bool operator>=(KeyCode const &a, KeyCode const &b)
Definition MyGUI_KeyCode.h:177
MyGUI::KeyCode::operator==
friend bool operator==(KeyCode const &a, KeyCode const &b)
Definition MyGUI_KeyCode.h:192
MyGUI::KeyCode::getValue
int getValue() const
Definition MyGUI_KeyCode.h:202
MyGUI::KeyCode::KeyCode
KeyCode(Enum _value=None)
Definition MyGUI_KeyCode.h:167
MyGUI::KeyCode::Enum
Enum
Definition MyGUI_KeyCode.h:18
MyGUI::KeyCode::RightAlt
@ RightAlt
Definition MyGUI_KeyCode.h:137
MyGUI::KeyCode::Delete
@ Delete
Definition MyGUI_KeyCode.h:148
MyGUI::KeyCode::Wake
@ Wake
Definition MyGUI_KeyCode.h:155
MyGUI::KeyCode::ABNT_C2
@ ABNT_C2
Definition MyGUI_KeyCode.h:114
MyGUI::KeyCode::B
@ B
Definition MyGUI_KeyCode.h:67
MyGUI::KeyCode::LeftWindows
@ LeftWindows
Definition MyGUI_KeyCode.h:149
MyGUI::KeyCode::Home
@ Home
Definition MyGUI_KeyCode.h:139
MyGUI::KeyCode::NumpadComma
@ NumpadComma
Definition MyGUI_KeyCode.h:134
MyGUI::KeyCode::Numpad9
@ Numpad9
Definition MyGUI_KeyCode.h:92
MyGUI::KeyCode::LeftAlt
@ LeftAlt
Definition MyGUI_KeyCode.h:75
MyGUI::KeyCode::WebSearch
@ WebSearch
Definition MyGUI_KeyCode.h:156
MyGUI::KeyCode::Three
@ Three
Definition MyGUI_KeyCode.h:23
MyGUI::KeyCode::Backspace
@ Backspace
Definition MyGUI_KeyCode.h:33
MyGUI::KeyCode::F6
@ F6
Definition MyGUI_KeyCode.h:83
MyGUI::KeyCode::LeftBracket
@ LeftBracket
Definition MyGUI_KeyCode.h:45
MyGUI::KeyCode::AppMenu
@ AppMenu
Definition MyGUI_KeyCode.h:152
MyGUI::KeyCode::N
@ N
Definition MyGUI_KeyCode.h:68
MyGUI::KeyCode::MediaSelect
@ MediaSelect
Definition MyGUI_KeyCode.h:164
MyGUI::KeyCode::F4
@ F4
Definition MyGUI_KeyCode.h:81
MyGUI::KeyCode::Seven
@ Seven
Definition MyGUI_KeyCode.h:27
MyGUI::KeyCode::K
@ K
Definition MyGUI_KeyCode.h:56
MyGUI::KeyCode::Numpad2
@ Numpad2
Definition MyGUI_KeyCode.h:99
MyGUI::KeyCode::F15
@ F15
Definition MyGUI_KeyCode.h:108
MyGUI::KeyCode::W
@ W
Definition MyGUI_KeyCode.h:36
MyGUI::KeyCode::One
@ One
Definition MyGUI_KeyCode.h:21
MyGUI::KeyCode::Apostrophe
@ Apostrophe
Definition MyGUI_KeyCode.h:59
MyGUI::KeyCode::Numpad5
@ Numpad5
Definition MyGUI_KeyCode.h:95
MyGUI::KeyCode::Multiply
@ Multiply
Definition MyGUI_KeyCode.h:74
MyGUI::KeyCode::P
@ P
Definition MyGUI_KeyCode.h:44
MyGUI::KeyCode::Zero
@ Zero
Definition MyGUI_KeyCode.h:30
MyGUI::KeyCode::Equals
@ Equals
Definition MyGUI_KeyCode.h:32
MyGUI::KeyCode::D
@ D
Definition MyGUI_KeyCode.h:51
MyGUI::KeyCode::F5
@ F5
Definition MyGUI_KeyCode.h:82
MyGUI::KeyCode::Numpad0
@ Numpad0
Definition MyGUI_KeyCode.h:101
MyGUI::KeyCode::Tab
@ Tab
Definition MyGUI_KeyCode.h:34
MyGUI::KeyCode::F3
@ F3
Definition MyGUI_KeyCode.h:80
MyGUI::KeyCode::Period
@ Period
Definition MyGUI_KeyCode.h:71
MyGUI::KeyCode::NumLock
@ NumLock
Definition MyGUI_KeyCode.h:88
MyGUI::KeyCode::A
@ A
Definition MyGUI_KeyCode.h:49
MyGUI::KeyCode::Eight
@ Eight
Definition MyGUI_KeyCode.h:28
MyGUI::KeyCode::PrevTrack
@ PrevTrack
Definition MyGUI_KeyCode.h:116
MyGUI::KeyCode::Mail
@ Mail
Definition MyGUI_KeyCode.h:163
MyGUI::KeyCode::ArrowRight
@ ArrowRight
Definition MyGUI_KeyCode.h:143
MyGUI::KeyCode::PageUp
@ PageUp
Definition MyGUI_KeyCode.h:141
MyGUI::KeyCode::F11
@ F11
Definition MyGUI_KeyCode.h:104
MyGUI::KeyCode::R
@ R
Definition MyGUI_KeyCode.h:38
MyGUI::KeyCode::At
@ At
Definition MyGUI_KeyCode.h:117
MyGUI::KeyCode::LeftShift
@ LeftShift
Definition MyGUI_KeyCode.h:61
MyGUI::KeyCode::Y
@ Y
Definition MyGUI_KeyCode.h:40
MyGUI::KeyCode::F13
@ F13
Definition MyGUI_KeyCode.h:106
MyGUI::KeyCode::Kana
@ Kana
Definition MyGUI_KeyCode.h:109
MyGUI::KeyCode::MyComputer
@ MyComputer
Definition MyGUI_KeyCode.h:162
MyGUI::KeyCode::RightWindows
@ RightWindows
Definition MyGUI_KeyCode.h:151
MyGUI::KeyCode::PlayPause
@ PlayPause
Definition MyGUI_KeyCode.h:129
MyGUI::KeyCode::Sleep
@ Sleep
Definition MyGUI_KeyCode.h:154
MyGUI::KeyCode::T
@ T
Definition MyGUI_KeyCode.h:39
MyGUI::KeyCode::Pause
@ Pause
Definition MyGUI_KeyCode.h:138
MyGUI::KeyCode::End
@ End
Definition MyGUI_KeyCode.h:144
MyGUI::KeyCode::Grave
@ Grave
Definition MyGUI_KeyCode.h:60
MyGUI::KeyCode::Numpad6
@ Numpad6
Definition MyGUI_KeyCode.h:96
MyGUI::KeyCode::NoConvert
@ NoConvert
Definition MyGUI_KeyCode.h:112
MyGUI::KeyCode::E
@ E
Definition MyGUI_KeyCode.h:37
MyGUI::KeyCode::Six
@ Six
Definition MyGUI_KeyCode.h:26
MyGUI::KeyCode::Space
@ Space
Definition MyGUI_KeyCode.h:76
MyGUI::KeyCode::L
@ L
Definition MyGUI_KeyCode.h:57
MyGUI::KeyCode::VolumeUp
@ VolumeUp
Definition MyGUI_KeyCode.h:132
MyGUI::KeyCode::NextTrack
@ NextTrack
Definition MyGUI_KeyCode.h:124
MyGUI::KeyCode::Escape
@ Escape
Definition MyGUI_KeyCode.h:20
MyGUI::KeyCode::Four
@ Four
Definition MyGUI_KeyCode.h:24
MyGUI::KeyCode::Stop
@ Stop
Definition MyGUI_KeyCode.h:121
MyGUI::KeyCode::NumpadEnter
@ NumpadEnter
Definition MyGUI_KeyCode.h:125
MyGUI::KeyCode::ScrollLock
@ ScrollLock
Definition MyGUI_KeyCode.h:89
MyGUI::KeyCode::Decimal
@ Decimal
Definition MyGUI_KeyCode.h:102
MyGUI::KeyCode::AX
@ AX
Definition MyGUI_KeyCode.h:122
MyGUI::KeyCode::Comma
@ Comma
Definition MyGUI_KeyCode.h:70
MyGUI::KeyCode::Minus
@ Minus
Definition MyGUI_KeyCode.h:31
MyGUI::KeyCode::Calculator
@ Calculator
Definition MyGUI_KeyCode.h:128
MyGUI::KeyCode::VolumeDown
@ VolumeDown
Definition MyGUI_KeyCode.h:131
MyGUI::KeyCode::F1
@ F1
Definition MyGUI_KeyCode.h:78
MyGUI::KeyCode::F14
@ F14
Definition MyGUI_KeyCode.h:107
MyGUI::KeyCode::M
@ M
Definition MyGUI_KeyCode.h:69
MyGUI::KeyCode::Colon
@ Colon
Definition MyGUI_KeyCode.h:118
MyGUI::KeyCode::Q
@ Q
Definition MyGUI_KeyCode.h:35
MyGUI::KeyCode::G
@ G
Definition MyGUI_KeyCode.h:53
MyGUI::KeyCode::RightWindow
@ RightWindow
Definition MyGUI_KeyCode.h:150
MyGUI::KeyCode::F8
@ F8
Definition MyGUI_KeyCode.h:85
MyGUI::KeyCode::S
@ S
Definition MyGUI_KeyCode.h:50
MyGUI::KeyCode::X
@ X
Definition MyGUI_KeyCode.h:64
MyGUI::KeyCode::Numpad7
@ Numpad7
Definition MyGUI_KeyCode.h:90
MyGUI::KeyCode::Semicolon
@ Semicolon
Definition MyGUI_KeyCode.h:58
MyGUI::KeyCode::ABNT_C1
@ ABNT_C1
Definition MyGUI_KeyCode.h:110
MyGUI::KeyCode::RightShift
@ RightShift
Definition MyGUI_KeyCode.h:73
MyGUI::KeyCode::WebFavorites
@ WebFavorites
Definition MyGUI_KeyCode.h:157
MyGUI::KeyCode::Unlabeled
@ Unlabeled
Definition MyGUI_KeyCode.h:123
MyGUI::KeyCode::Insert
@ Insert
Definition MyGUI_KeyCode.h:147
MyGUI::KeyCode::SysRq
@ SysRq
Definition MyGUI_KeyCode.h:136
MyGUI::KeyCode::Five
@ Five
Definition MyGUI_KeyCode.h:25
MyGUI::KeyCode::WebStop
@ WebStop
Definition MyGUI_KeyCode.h:159
MyGUI::KeyCode::ArrowDown
@ ArrowDown
Definition MyGUI_KeyCode.h:145
MyGUI::KeyCode::Yen
@ Yen
Definition MyGUI_KeyCode.h:113
MyGUI::KeyCode::F12
@ F12
Definition MyGUI_KeyCode.h:105
MyGUI::KeyCode::WebHome
@ WebHome
Definition MyGUI_KeyCode.h:133
MyGUI::KeyCode::Numpad1
@ Numpad1
Definition MyGUI_KeyCode.h:98
MyGUI::KeyCode::Numpad8
@ Numpad8
Definition MyGUI_KeyCode.h:91
MyGUI::KeyCode::LeftControl
@ LeftControl
Definition MyGUI_KeyCode.h:48
MyGUI::KeyCode::Two
@ Two
Definition MyGUI_KeyCode.h:22
MyGUI::KeyCode::F
@ F
Definition MyGUI_KeyCode.h:52
MyGUI::KeyCode::O
@ O
Definition MyGUI_KeyCode.h:43
MyGUI::KeyCode::Underline
@ Underline
Definition MyGUI_KeyCode.h:119
MyGUI::KeyCode::F10
@ F10
Definition MyGUI_KeyCode.h:87
MyGUI::KeyCode::WebRefresh
@ WebRefresh
Definition MyGUI_KeyCode.h:158
MyGUI::KeyCode::ArrowUp
@ ArrowUp
Definition MyGUI_KeyCode.h:140
MyGUI::KeyCode::U
@ U
Definition MyGUI_KeyCode.h:41
MyGUI::KeyCode::F9
@ F9
Definition MyGUI_KeyCode.h:86
MyGUI::KeyCode::F7
@ F7
Definition MyGUI_KeyCode.h:84
MyGUI::KeyCode::Capital
@ Capital
Definition MyGUI_KeyCode.h:77
MyGUI::KeyCode::J
@ J
Definition MyGUI_KeyCode.h:55
MyGUI::KeyCode::V
@ V
Definition MyGUI_KeyCode.h:66
MyGUI::KeyCode::Power
@ Power
Definition MyGUI_KeyCode.h:153
MyGUI::KeyCode::None
@ None
Definition MyGUI_KeyCode.h:19
MyGUI::KeyCode::OEM_102
@ OEM_102
Definition MyGUI_KeyCode.h:103
MyGUI::KeyCode::RightControl
@ RightControl
Definition MyGUI_KeyCode.h:126
MyGUI::KeyCode::WebBack
@ WebBack
Definition MyGUI_KeyCode.h:161
MyGUI::KeyCode::Numpad4
@ Numpad4
Definition MyGUI_KeyCode.h:94
MyGUI::KeyCode::ArrowLeft
@ ArrowLeft
Definition MyGUI_KeyCode.h:142
MyGUI::KeyCode::H
@ H
Definition MyGUI_KeyCode.h:54
MyGUI::KeyCode::I
@ I
Definition MyGUI_KeyCode.h:42
MyGUI::KeyCode::F2
@ F2
Definition MyGUI_KeyCode.h:79
MyGUI::KeyCode::WebForward
@ WebForward
Definition MyGUI_KeyCode.h:160
MyGUI::KeyCode::Add
@ Add
Definition MyGUI_KeyCode.h:97
MyGUI::KeyCode::Backslash
@ Backslash
Definition MyGUI_KeyCode.h:62
MyGUI::KeyCode::Divide
@ Divide
Definition MyGUI_KeyCode.h:135
MyGUI::KeyCode::RightBracket
@ RightBracket
Definition MyGUI_KeyCode.h:46
MyGUI::KeyCode::Slash
@ Slash
Definition MyGUI_KeyCode.h:72
MyGUI::KeyCode::Nine
@ Nine
Definition MyGUI_KeyCode.h:29
MyGUI::KeyCode::Return
@ Return
Definition MyGUI_KeyCode.h:47
MyGUI::KeyCode::Convert
@ Convert
Definition MyGUI_KeyCode.h:111
MyGUI::KeyCode::Kanji
@ Kanji
Definition MyGUI_KeyCode.h:120
MyGUI::KeyCode::C
@ C
Definition MyGUI_KeyCode.h:65
MyGUI::KeyCode::Z
@ Z
Definition MyGUI_KeyCode.h:63
MyGUI::KeyCode::Subtract
@ Subtract
Definition MyGUI_KeyCode.h:93
MyGUI::KeyCode::Numpad3
@ Numpad3
Definition MyGUI_KeyCode.h:100
MyGUI::KeyCode::PageDown
@ PageDown
Definition MyGUI_KeyCode.h:146
MyGUI::KeyCode::Mute
@ Mute
Definition MyGUI_KeyCode.h:127
MyGUI::KeyCode::MediaStop
@ MediaStop
Definition MyGUI_KeyCode.h:130
MyGUI::KeyCode::NumpadEquals
@ NumpadEquals
Definition MyGUI_KeyCode.h:115
MyGUI::KeyCode::operator<
friend bool operator<(KeyCode const &a, KeyCode const &b)
Definition MyGUI_KeyCode.h:172
MyGUI::KeyCode::operator>
friend bool operator>(KeyCode const &a, KeyCode const &b)
Definition MyGUI_KeyCode.h:182
MyGUI::KeyCode::operator!=
friend bool operator!=(KeyCode const &a, KeyCode const &b)
Definition MyGUI_KeyCode.h:197
MyGUI::KeyCode::operator<=
friend bool operator<=(KeyCode const &a, KeyCode const &b)
Definition MyGUI_KeyCode.h:187