PageRenderTime 477ms CodeModel.GetById 214ms app.highlight 83ms RepoModel.GetById 178ms app.codeStats 0ms

/src/ftk_key.h

http://ftk.googlecode.com/
C++ Header | 191 lines | 155 code | 7 blank | 29 comment | 7 complexity | 337effa9d22a5128a1096b2d6beccbbc MD5 | raw file
  1/*
  2 * File: ftk_key.h
  3 * Author:  Li XianJing <xianjimli@hotmail.com>
  4 * Brief:   key symbols
  5 *
  6 * Copyright (c) 2009 - 2010  Li XianJing <xianjimli@hotmail.com>
  7 *
  8 * Licensed under the Academic Free License version 2.1
  9 *
 10 * This program is free software; you can redistribute it and/or modify
 11 * it under the terms of the GNU General Public License as published by
 12 * the Free Software Foundation; either version 2 of the License, or
 13 * (at your option) any later version.
 14 *
 15 * This program 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 General Public License for more details.
 19 *
 20 * You should have received a copy of the GNU General Public License
 21 * along with this program; if not, write to the Free Software
 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 23 */
 24
 25/*
 26 * History:
 27 * ================================================================
 28 * 2009-10-03 Li XianJing <xianjimli@hotmail.com> created
 29 *
 30 */
 31#ifndef _FTK_KEY_H
 32#define _FTK_KEY_H
 33
 34#include "ftk_typedef.h"
 35
 36FTK_BEGIN_DECLS
 37
 38typedef enum _FtkKey
 39{
 40	FTK_KEY_SPACE         =  0x020,
 41	FTK_KEY_EXCLAM        =  0x021,
 42	FTK_KEY_QUOTEDBL      =  0x022,
 43	FTK_KEY_NUMBERSIGN    =  0x023,
 44	FTK_KEY_DOLLAR        =  0x024,
 45	FTK_KEY_PERCENT       =  0x025,
 46	FTK_KEY_AMPERSAND     =  0x026,
 47	FTK_KEY_APOSTROPHE    =  0x027,
 48	FTK_KEY_QUOTERIGHT    =  0x027,
 49	FTK_KEY_PARENLEFT     =  0x028,
 50	FTK_KEY_PARENRIGHT    =  0x029,
 51	FTK_KEY_ASTERISK      =  0x02a,
 52	FTK_KEY_PLUS          =  0x02b,
 53	FTK_KEY_COMMA         =  0x02c,
 54	FTK_KEY_MINUS         =  0x02d,
 55	FTK_KEY_PERIOD        =  0x02e,
 56	FTK_KEY_SLASH         =  0x02f,
 57	FTK_KEY_0             =  0x030,
 58	FTK_KEY_1             =  0x031,
 59	FTK_KEY_2             =  0x032,
 60	FTK_KEY_3             =  0x033,
 61	FTK_KEY_4             =  0x034,
 62	FTK_KEY_5             =  0x035,
 63	FTK_KEY_6             =  0x036,
 64	FTK_KEY_7             =  0x037,
 65	FTK_KEY_8             =  0x038,
 66	FTK_KEY_9             =  0x039,
 67	FTK_KEY_COLON         =  0x03a,
 68	FTK_KEY_SEMICOLON     =  0x03b,
 69	FTK_KEY_LESS          =  0x03c,
 70	FTK_KEY_EQUAL         =  0x03d,
 71	FTK_KEY_GREATER       =  0x03e,
 72	FTK_KEY_QUESTION      =  0x03f,
 73	FTK_KEY_AT            =  0X040,
 74	FTK_KEY_A             =  0x041,
 75	FTK_KEY_B             =  0x042,
 76	FTK_KEY_C             =  0x043,
 77	FTK_KEY_D             =  0x044,
 78	FTK_KEY_E             =  0x045,
 79	FTK_KEY_F             =  0x046,
 80	FTK_KEY_G             =  0x047,
 81	FTK_KEY_H             =  0x048,
 82	FTK_KEY_I             =  0x049,
 83	FTK_KEY_J             =  0x04a,
 84	FTK_KEY_K             =  0x04b,
 85	FTK_KEY_L             =  0x04c,
 86	FTK_KEY_M             =  0x04d,
 87	FTK_KEY_N             =  0x04e,
 88	FTK_KEY_O             =  0x04f,
 89	FTK_KEY_P             =  0x050,
 90	FTK_KEY_Q             =  0x051,
 91	FTK_KEY_R             =  0x052,
 92	FTK_KEY_S             =  0x053,
 93	FTK_KEY_T             =  0x054,
 94	FTK_KEY_U             =  0x055,
 95	FTK_KEY_V             =  0x056,
 96	FTK_KEY_W             =  0x057,
 97	FTK_KEY_X             =  0x058,
 98	FTK_KEY_Y             =  0x059,
 99	FTK_KEY_Z             =  0x05a,
100	FTK_KEY_BRACKETLEFT   =  0x05b,
101	FTK_KEY_BACKSLASH     =  0x05c,
102	FTK_KEY_BRACKETRIGHT  =  0x05d,
103	FTK_KEY_ASCIICIRCUM   =  0x05e,
104	FTK_KEY_UNDERSCORE    =  0x05f,
105	FTK_KEY_QUOTELEFT     =  0x060,
106	FTK_KEY_GRAVE         =  0x060,
107	FTK_KEY_a             =  0x061,
108	FTK_KEY_b             =  0x062,
109	FTK_KEY_c             =  0x063,
110	FTK_KEY_d             =  0x064,
111	FTK_KEY_e             =  0x065,
112	FTK_KEY_f             =  0x066,
113	FTK_KEY_g             =  0x067,
114	FTK_KEY_h             =  0x068,
115	FTK_KEY_i             =  0x069,
116	FTK_KEY_j             =  0x06a,
117	FTK_KEY_k             =  0x06b,
118	FTK_KEY_l             =  0x06c,
119	FTK_KEY_m             =  0x06d,
120	FTK_KEY_n             =  0x06e,
121	FTK_KEY_o             =  0x06f,
122	FTK_KEY_p             =  0x070,
123	FTK_KEY_q             =  0x071,
124	FTK_KEY_r             =  0x072,
125	FTK_KEY_s             =  0x073,
126	FTK_KEY_t             =  0x074,
127	FTK_KEY_u             =  0x075,
128	FTK_KEY_v             =  0x076,
129	FTK_KEY_w             =  0x077,
130	FTK_KEY_x             =  0x078,
131	FTK_KEY_y             =  0x079,
132	FTK_KEY_z             =  0x07a,
133	FTK_KEY_LEFTBRACE     =  0x07B,
134	FTK_KEY_OR            =  0x07C,
135	FTK_KEY_RIGHTBRACE    =  0x07D,
136	FTK_KEY_NOT           =  0x07E,
137	FTK_KEY_DOT           =  '.',
138	FTK_KEY_HOME          =  0xFF50,
139	FTK_KEY_LEFT          =  0xFF51,
140	FTK_KEY_UP            =  0xFF52,
141	FTK_KEY_RIGHT         =  0xFF53,
142	FTK_KEY_DOWN          =  0xFF54,
143	FTK_KEY_PRIOR         =  0xFF55,
144	FTK_KEY_PAGEUP        =  0xFF55,
145	FTK_KEY_NEXT          =  0xFF56,
146	FTK_KEY_PAGEDOWN      =  0xFF56,
147	FTK_KEY_END           =  0xFF57,
148	FTK_KEY_BEGIN         =  0xFF58,
149	FTK_KEY_INSERT        =  0xFF63,
150	FTK_KEY_ENTER         =  0xFF0D,
151	FTK_KEY_TAB           =  0xFF09,
152	FTK_KEY_ESC           =  0xFF1B,
153	FTK_KEY_RIGHTCTRL   =  0xFFE4,
154	FTK_KEY_LEFTCTRL    =  0xFFE3,
155	FTK_KEY_RIGHTALT    =  0xFFEA,
156	FTK_KEY_LEFTALT     =  0xFFE9,
157	FTK_KEY_RIGHTSHIFT  =  0xFFE2,
158	FTK_KEY_LEFTSHIFT   =  0xFFE1,
159	FTK_KEY_DELETE      =  0xFFFF,
160	FTK_KEY_F1          =  0xFFBE,
161	FTK_KEY_F2          =  0xFFBF,
162	FTK_KEY_F3          =  0xFFC0,
163	FTK_KEY_RETURN      = FTK_KEY_F3,
164	FTK_KEY_F4          =  0xFFC1,
165	FTK_KEY_F5          =  0xFFC2,
166	FTK_KEY_F6          =  0xFFC3,
167	FTK_KEY_F7          =  0xFFC4,
168	FTK_KEY_F8          =  0xFFC5,
169	FTK_KEY_F9          =  0xFFC6,
170	FTK_KEY_F10         =  0xFFC7,
171	FTK_KEY_CAPSLOCK    =  0xFFE5,
172	FTK_KEY_BACKSPACE   =  0xFF08,
173	FTK_KEY_SEND        =  0xFFA1,
174	FTK_KEY_REPLY       =  0xFFA2,
175	FTK_KEY_SAVE        =  0xFFA3,
176	FTK_KEY_BATTERY     =  0xFFA4,
177	FTK_KEY_BLUETOOTH   =  0xFFA5,
178	FTK_KEY_WLAN        =  0xFFA6,
179	FTK_KEY_POWER       =  0xFFA7,
180	FTK_KEY_MENU        = FTK_KEY_F2,
181	FTK_KEY_CHOOSE_IME  = FTK_KEY_F4,
182	FTK_KEY_CLR         =  0xFFA8,
183}FtkKey;
184
185#define FTK_IS_DIGIT(key) ((key) >= FTK_KEY_0 && (key) <= FTK_KEY_9)
186#define FTK_IS_ALPHA(key) ((key) >= FTK_KEY_A && (key) <= FTK_KEY_Z) && ((key) >= FTK_KEY_a && (key) <= FTK_KEY_z)
187#define FTK_IS_ACTIVE_KEY(key) ((key) == FTK_KEY_ENTER || (key) == FTK_KEY_SPACE)
188
189FTK_END_DECLS
190
191#endif/*_FTK_KEY_H*/