00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef HK_KEY
00012 #define HK_KEY
00013 #include "hk_class.h"
00014 class hk_keyprivate;
00015
00016
00017
00018
00019
00028 class hk_key:public hk_class
00029 {
00030 friend class hk_visibleprivate;
00031 public:
00036 enum enum_keycode {
00037 key_Escape = 0x1000,
00038 key_Tab = 0x1001,
00039 key_Backtab = 0x1002, key_BackTab = key_Backtab,
00040 key_Backspace = 0x1003, key_BackSpace = key_Backspace,
00041 key_Return = 0x1004,
00042 key_Enter = 0x1005,
00043 key_Insert = 0x1006,
00044 key_Delete = 0x1007,
00045 key_Pause = 0x1008,
00046 key_Print = 0x1009,
00047 key_SysReq = 0x100a,
00048 key_Clear = 0x100b,
00049 key_Home = 0x1010,
00050 key_End = 0x1011,
00051 key_Left = 0x1012,
00052 key_Up = 0x1013,
00053 key_Right = 0x1014,
00054 key_Down = 0x1015,
00055 key_Prior = 0x1016, key_PageUp = key_Prior,
00056 key_Next = 0x1017, key_PageDown = key_Next,
00057 key_Shift = 0x1020,
00058 key_Control = 0x1021,
00059 key_Meta = 0x1022,
00060 key_Alt = 0x1023,
00061 key_CapsLock = 0x1024,
00062 key_NumLock = 0x1025,
00063 key_ScrollLock = 0x1026,
00064 key_F1 = 0x1030,
00065 key_F2 = 0x1031,
00066 key_F3 = 0x1032,
00067 key_F4 = 0x1033,
00068 key_F5 = 0x1034,
00069 key_F6 = 0x1035,
00070 key_F7 = 0x1036,
00071 key_F8 = 0x1037,
00072 key_F9 = 0x1038,
00073 key_F10 = 0x1039,
00074 key_F11 = 0x103a,
00075 key_F12 = 0x103b,
00076 key_F13 = 0x103c,
00077 key_F14 = 0x103d,
00078 key_F15 = 0x103e,
00079 key_F16 = 0x103f,
00080 key_F17 = 0x1040,
00081 key_F18 = 0x1041,
00082 key_F19 = 0x1042,
00083 key_F20 = 0x1043,
00084 key_F21 = 0x1044,
00085 key_F22 = 0x1045,
00086 key_F23 = 0x1046,
00087 key_F24 = 0x1047,
00088 key_F25 = 0x1048,
00089 key_F26 = 0x1049,
00090 key_F27 = 0x104a,
00091 key_F28 = 0x104b,
00092 key_F29 = 0x104c,
00093 key_F30 = 0x104d,
00094 key_F31 = 0x104e,
00095 key_F32 = 0x104f,
00096 key_F33 = 0x1050,
00097 key_F34 = 0x1051,
00098 key_F35 = 0x1052,
00099 key_Super_L = 0x1053,
00100 key_Super_R = 0x1054,
00101 key_Menu = 0x1055,
00102 key_Hyper_L = 0x1056,
00103 key_Hyper_R = 0x1057,
00104 key_Help = 0x1058,
00105 key_Direction_L = 0x1059,
00106 key_Direction_R = 0x1060,
00107
00108
00109
00110
00111
00112 key_Multi_key = 0x1120,
00113 key_Codeinput = 0x1137,
00114 key_SingleCandidate = 0x113c,
00115 key_MultipleCandidate = 0x113d,
00116 key_PreviousCandidate = 0x113e,
00117
00118
00119 key_Mode_switch = 0x117e,
00120
00121
00122
00123 key_Kanji = 0x1121,
00124 key_Muhenkan = 0x1122,
00125
00126 key_Henkan = 0x1123,
00127 key_Romaji = 0x1124,
00128 key_Hiragana = 0x1125,
00129 key_Katakana = 0x1126,
00130 key_Hiragana_Katakana = 0x1127,
00131 key_Zenkaku = 0x1128,
00132 key_Hankaku = 0x1129,
00133 key_Zenkaku_Hankaku = 0x112a,
00134 key_Touroku = 0x112b,
00135 key_Massyo = 0x112c,
00136 key_Kana_Lock = 0x112d,
00137 key_Kana_Shift = 0x112e,
00138 key_Eisu_Shift = 0x112f,
00139 key_Eisu_toggle = 0x1130,
00140
00141
00142
00143
00144
00145 key_Hangul = 0x1131,
00146 key_Hangul_Start = 0x1132,
00147 key_Hangul_End = 0x1133,
00148 key_Hangul_Hanja = 0x1134,
00149 key_Hangul_Jamo = 0x1135,
00150 key_Hangul_Romaja = 0x1136,
00151 key_Hangul_Codeinput = 0x1137,
00152 key_Hangul_Jeonja = 0x1138,
00153 key_Hangul_Banja = 0x1139,
00154 key_Hangul_PreHanja = 0x113a,
00155 key_Hangul_PostHanja = 0x113b,
00156 key_Hangul_SingleCandidate = 0x113c,
00157 key_Hangul_MultipleCandidate = 0x113d,
00158 key_Hangul_PreviousCandidate = 0x113e,
00159 key_Hangul_Special = 0x113f,
00160
00161
00162 key_Space = 0x20,
00163 key_Any = key_Space,
00164 key_Exclam = 0x21,
00165 key_QuoteDbl = 0x22,
00166 key_NumberSign = 0x23,
00167 key_Dollar = 0x24,
00168 key_Percent = 0x25,
00169 key_Ampersand = 0x26,
00170 key_Apostrophe = 0x27,
00171 key_ParenLeft = 0x28,
00172 key_ParenRight = 0x29,
00173 key_Asterisk = 0x2a,
00174 key_Plus = 0x2b,
00175 key_Comma = 0x2c,
00176 key_Minus = 0x2d,
00177 key_Period = 0x2e,
00178 key_Slash = 0x2f,
00179 key_0 = 0x30,
00180 key_1 = 0x31,
00181 key_2 = 0x32,
00182 key_3 = 0x33,
00183 key_4 = 0x34,
00184 key_5 = 0x35,
00185 key_6 = 0x36,
00186 key_7 = 0x37,
00187 key_8 = 0x38,
00188 key_9 = 0x39,
00189 key_Colon = 0x3a,
00190 key_Semicolon = 0x3b,
00191 key_Less = 0x3c,
00192 key_Equal = 0x3d,
00193 key_Greater = 0x3e,
00194 key_Question = 0x3f,
00195 key_At = 0x40,
00196 key_A = 0x41,
00197 key_B = 0x42,
00198 key_C = 0x43,
00199 key_D = 0x44,
00200 key_E = 0x45,
00201 key_F = 0x46,
00202 key_G = 0x47,
00203 key_H = 0x48,
00204 key_I = 0x49,
00205 key_J = 0x4a,
00206 key_K = 0x4b,
00207 key_L = 0x4c,
00208 key_M = 0x4d,
00209 key_N = 0x4e,
00210 key_O = 0x4f,
00211 key_P = 0x50,
00212 key_Q = 0x51,
00213 key_R = 0x52,
00214 key_S = 0x53,
00215 key_T = 0x54,
00216 key_U = 0x55,
00217 key_V = 0x56,
00218 key_W = 0x57,
00219 key_X = 0x58,
00220 key_Y = 0x59,
00221 key_Z = 0x5a,
00222 key_BracketLeft = 0x5b,
00223 key_Backslash = 0x5c,
00224 key_BracketRight = 0x5d,
00225 key_AsciiCircum = 0x5e,
00226 key_Underscore = 0x5f,
00227 key_QuoteLeft = 0x60,
00228 key_BraceLeft = 0x7b,
00229 key_Bar = 0x7c,
00230 key_BraceRight = 0x7d,
00231 key_AsciiTilde = 0x7e,
00232
00233
00234
00235 key_nobreakspace = 0x0a0,
00236 key_exclamdown = 0x0a1,
00237 key_cent = 0x0a2,
00238 key_sterling = 0x0a3,
00239 key_currency = 0x0a4,
00240 key_yen = 0x0a5,
00241 key_brokenbar = 0x0a6,
00242 key_section = 0x0a7,
00243 key_diaeresis = 0x0a8,
00244 key_copyright = 0x0a9,
00245 key_ordfeminine = 0x0aa,
00246 key_guillemotleft = 0x0ab,
00247 key_notsign = 0x0ac,
00248 key_hyphen = 0x0ad,
00249 key_registered = 0x0ae,
00250 key_macron = 0x0af,
00251 key_degree = 0x0b0,
00252 key_plusminus = 0x0b1,
00253 key_twosuperior = 0x0b2,
00254 key_threesuperior = 0x0b3,
00255 key_acute = 0x0b4,
00256 key_mu = 0x0b5,
00257 key_paragraph = 0x0b6,
00258 key_periodcentered = 0x0b7,
00259 key_cedilla = 0x0b8,
00260 key_onesuperior = 0x0b9,
00261 key_masculine = 0x0ba,
00262 key_guillemotright = 0x0bb,
00263 key_onequarter = 0x0bc,
00264 key_onehalf = 0x0bd,
00265 key_threequarters = 0x0be,
00266 key_questiondown = 0x0bf,
00267 key_Agrave = 0x0c0,
00268 key_Aacute = 0x0c1,
00269 key_Acircumflex = 0x0c2,
00270 key_Atilde = 0x0c3,
00271 key_Adiaeresis = 0x0c4,
00272 key_Aring = 0x0c5,
00273 key_AE = 0x0c6,
00274 key_Ccedilla = 0x0c7,
00275 key_Egrave = 0x0c8,
00276 key_Eacute = 0x0c9,
00277 key_Ecircumflex = 0x0ca,
00278 key_Ediaeresis = 0x0cb,
00279 key_Igrave = 0x0cc,
00280 key_Iacute = 0x0cd,
00281 key_Icircumflex = 0x0ce,
00282 key_Idiaeresis = 0x0cf,
00283 key_ETH = 0x0d0,
00284 key_Ntilde = 0x0d1,
00285 key_Ograve = 0x0d2,
00286 key_Oacute = 0x0d3,
00287 key_Ocircumflex = 0x0d4,
00288 key_Otilde = 0x0d5,
00289 key_Odiaeresis = 0x0d6,
00290 key_multiply = 0x0d7,
00291 key_Ooblique = 0x0d8,
00292 key_Ugrave = 0x0d9,
00293 key_Uacute = 0x0da,
00294 key_Ucircumflex = 0x0db,
00295 key_Udiaeresis = 0x0dc,
00296 key_Yacute = 0x0dd,
00297 key_THORN = 0x0de,
00298 key_ssharp = 0x0df,
00299 key_agrave = 0x0e0,
00300 key_aacute = 0x0e1,
00301 key_acircumflex = 0x0e2,
00302 key_atilde = 0x0e3,
00303 key_adiaeresis = 0x0e4,
00304 key_aring = 0x0e5,
00305 key_ae = 0x0e6,
00306 key_ccedilla = 0x0e7,
00307 key_egrave = 0x0e8,
00308 key_eacute = 0x0e9,
00309 key_ecircumflex = 0x0ea,
00310 key_ediaeresis = 0x0eb,
00311 key_igrave = 0x0ec,
00312 key_iacute = 0x0ed,
00313 key_icircumflex = 0x0ee,
00314 key_idiaeresis = 0x0ef,
00315 key_eth = 0x0f0,
00316 key_ntilde = 0x0f1,
00317 key_ograve = 0x0f2,
00318 key_oacute = 0x0f3,
00319 key_ocircumflex = 0x0f4,
00320 key_otilde = 0x0f5,
00321 key_odiaeresis = 0x0f6,
00322 key_division = 0x0f7,
00323 key_oslash = 0x0f8,
00324 key_ugrave = 0x0f9,
00325 key_uacute = 0x0fa,
00326 key_ucircumflex = 0x0fb,
00327 key_udiaeresis = 0x0fc,
00328 key_yacute = 0x0fd,
00329 key_thorn = 0x0fe,
00330 key_ydiaeresis = 0x0ff,
00331
00332
00333
00334 key_Back = 0x1061,
00335 key_Forward = 0x1062,
00336 key_Stop = 0x1063,
00337 key_Refresh = 0x1064,
00338
00339 key_VolumeDown = 0x1070,
00340 key_VolumeMute = 0x1071,
00341 key_VolumeUp = 0x1072,
00342 key_BassBoost = 0x1073,
00343 key_BassUp = 0x1074,
00344 key_BassDown = 0x1075,
00345 key_TrebleUp = 0x1076,
00346 key_TrebleDown = 0x1077,
00347
00348 key_MediaPlay = 0x1080,
00349 key_MediaStop = 0x1081,
00350 key_MediaPrev = 0x1082,
00351 key_MediaNext = 0x1083,
00352 key_MediaRecord = 0x1084,
00353
00354 key_HomePage = 0x1090,
00355 key_Favorites = 0x1091,
00356 key_Search = 0x1092,
00357 key_Standby = 0x1093,
00358 key_OpenUrl = 0x1094,
00359
00360 key_LaunchMail = 0x10a0,
00361 key_LaunchMedia = 0x10a1,
00362 key_Launch0 = 0x10a2,
00363 key_Launch1 = 0x10a3,
00364 key_Launch2 = 0x10a4,
00365 key_Launch3 = 0x10a5,
00366 key_Launch4 = 0x10a6,
00367 key_Launch5 = 0x10a7,
00368 key_Launch6 = 0x10a8,
00369 key_Launch7 = 0x10a9,
00370 key_Launch8 = 0x10aa,
00371 key_Launch9 = 0x10ab,
00372 key_LaunchA = 0x10ac,
00373 key_LaunchB = 0x10ad,
00374 key_LaunchC = 0x10ae,
00375 key_LaunchD = 0x10af,
00376 key_LaunchE = 0x10b0,
00377 key_LaunchF = 0x10b1,
00378
00379 key_MediaLast = 0x1fff,
00380
00381 key_unknown = 0xffff
00382 };
00383
00384
00385
00386 hk_key(int keycode,int keystate,const hk_string& keytext);
00387 hk_key(const hk_key&);
00388 virtual ~hk_key();
00389 enum enum_state{state_normal=0x0000,state_shift=0x0100,state_ctrl=0x0200, state_alt = 0x0400};
00393 int state() const;
00397 int key() const;
00401 hk_string text() const;
00402
00403
00404 bool operator=(const hk_key&);
00405 bool operator==(const hk_key&);
00406 bool operator!=(const hk_key&);
00410 bool accept_key(void) const;
00414 void set_accept_key(bool);
00415
00416 protected:
00417 hk_key();
00418
00419 private:
00420 hk_keyprivate* p_private;
00421
00422 };
00423
00424
00425 #endif //HK_KEY