KeyEvent.h

Go to the documentation of this file.
00001 #ifndef JAVA_AWT_EVENT_KEYEVENT_H
00002 #define JAVA_AWT_EVENT_KEYEVENT_H 1
00003 
00004 #ifndef JAVA_AWT_POINT_H
00005 #include <java_awt/Point.h>
00006 #endif /* JAVA_AWT_POINT_H */
00007 #ifndef JAVA_LANG_SYNC_H
00008 #include <java_lang/Sync.h>
00009 #endif /* JAVA_LANG_SYNC_H */
00010 #ifndef JAVA_AWT_EVENT_INPUTEVENT_H
00011 #include <java_awt_event/InputEvent.h>
00012 #endif /* JAVA_AWT_EVENT_INPUTEVENT_H */
00013 #ifndef JAVA_AWT_SPEC
00014 #include <java_awt/Spec.h>
00015 #endif /* JAVA_AWT_SPEC */
00016 
00017 namespace java {
00018   namespace awt {
00019     namespace event {
00020 
00112       class JAVA_AWT_SPEC KeyEvent : public InputEvent {
00113 
00114       public:
00115 
00116         enum KEY_EVENT_ID {
00117 
00121           KEY_FIRST = 400,
00122 
00130           KEY_TYPED = KEY_FIRST,
00131 
00136           KEY_PRESSED,
00137 
00142           KEY_RELEASED = 2 + KEY_FIRST,
00143 
00147           KEY_LAST  = KEY_RELEASED,
00148 
00149         };
00150 
00151         enum KEY_LOCATION_ID {
00152 
00153           KEY_LOCATION_FIRST = 0,
00154 
00162           KEY_LOCATION_UNKNOWN  = KEY_LOCATION_FIRST,
00163 
00172           KEY_LOCATION_STANDARD,
00173 
00180           KEY_LOCATION_LEFT,
00181 
00188           KEY_LOCATION_RIGHT,
00189 
00196           KEY_LOCATION_NUMPAD,
00197 
00198           KEY_LOCATION_LAST = KEY_LOCATION_NUMPAD,
00199 
00200         };
00201 
00202         enum VIRTUAL_KEY_CODES {
00203 
00209           JK_UNDEFINED      = 0x00,
00210           JK_01,
00211           JK_02,
00212           JK_CANCEL,
00213           JK_04,
00214           JK_05,
00215           JK_06,
00216           JK_07,
00217           JK_BACK_SPACE     = 0x08,
00218           JK_TAB            = 0x09,
00219           JK_ENTER          = 0x0A,
00220           JK_CLEAR          = 0x0B,
00221           JK_0C,
00222           JK_0D,
00223           JK_0E,
00224           JK_0F,
00225           JK_SHIFT          = 0x10,
00226           JK_CONTROL        = 0x11,
00227           JK_ALT            = 0x12,
00228           JK_PAUSE          = 0x13,
00229           JK_CAPS_LOCK      = 0x14,
00230 
00231           /* replaced by VK_KANA_LOCK for Microsoft Windows and Solaris; 
00232              might still be used on other platforms */
00233           JK_KANA           = 0x15,
00234           JK_16,
00235           JK_17,
00236           /* not clear what this means - listed in Microsoft Windows API */
00237           JK_FINAL          = 0x18,
00238     
00239           /* replaced by VK_INPUT_METHOD_ON_OFF for Microsoft Windows and Solaris; 
00240              might still be used for other platforms */
00241           JK_KANJI          = 0x19,
00242           JK_1A,
00243           JK_ESCAPE         = 0x1B,
00244 
00245           /* Japanese PC 106 keyboard, Japanese Solaris keyboard: henkan */
00246           JK_CONVERT        = 0x1C,
00247 
00249           /* Japanese PC 106 keyboard: muhenkan */
00250           JK_NONCONVERT     = 0x1D,
00251     
00253           /* Japanese Solaris keyboard: kakutei */
00254           JK_ACCEPT         = 0x1E,
00255 
00256           /* not clear what this means - listed in Microsoft Windows API */
00257           JK_MODECHANGE     = 0x1F,
00258 
00259           JK_SPACE          = 0x20,
00260           JK_PAGE_UP        = 0x21,
00261           JK_PAGE_DOWN      = 0x22,
00262           JK_END            = 0x23,
00263           JK_HOME           = 0x24,
00264 
00269           JK_LEFT           = 0x25,
00270 
00275           JK_UP             = 0x26,
00276 
00281           JK_RIGHT          = 0x27,
00282 
00287           JK_DOWN           = 0x28,
00288           JK_29,
00289           JK_2A,
00290           JK_2B,
00291           JK_COMMA          = 0x2C,
00292 
00297           JK_MINUS          = 0x2D,
00298 
00299           JK_PERIOD         = 0x2E,
00300           JK_SLASH          = 0x2F,
00301 
00303           JK_0              = 0x30,
00304           JK_1,
00305           JK_2,
00306           JK_3,
00307           JK_4,
00308           JK_5,
00309           JK_6,
00310           JK_7,
00311           JK_8,
00312           JK_9, // 0x39
00313           JK_3A,
00314           JK_SEMICOLON      = 0x3B,
00315           JK_3C,
00316           JK_EQUALS         = 0x3D,
00317           JK_3E,
00318           JK_3F,
00319           JK_40,
00321           JK_A              = 0x41,
00322           JK_B,
00323           JK_C,
00324           JK_D,
00325           JK_E,
00326           JK_F,
00327           JK_G,
00328           JK_H,
00329           JK_I,
00330           JK_J,
00331           JK_K,
00332           JK_L,
00333           JK_M,
00334           JK_N,
00335           JK_O,
00336           JK_P,
00337           JK_Q,
00338           JK_R,
00339           JK_S,
00340           JK_T,
00341           JK_U,
00342           JK_V,
00343           JK_W,
00344           JK_X,
00345           JK_Y,
00346           JK_Z, // 0x5A
00347 
00348           JK_OPEN_BRACKET   = 0x5B,
00349           JK_BACK_SLASH     = 0x5C,
00350           JK_CLOSE_BRACKET  = 0x5D,
00351           JK_5E,
00352           JK_5F,
00353 
00354           JK_NUMPAD0        = 0x60,
00355           JK_NUMPAD1,
00356           JK_NUMPAD2,
00357           JK_NUMPAD3,
00358           JK_NUMPAD4,
00359           JK_NUMPAD5,
00360           JK_NUMPAD6,
00361           JK_NUMPAD7,
00362           JK_NUMPAD8,
00363           JK_NUMPAD9, // 0x69
00364           JK_MULTIPLY       = 0x6A,
00365           JK_ADD            = 0x6B,
00366 
00371           JK_SEPARATOR      = 0x6C,
00372 
00373           JK_SUBTRACT       = 0x6D,
00374           JK_DECIMAL        = 0x6E,
00375           JK_DIVIDE         = 0x6F,
00376 
00378           JK_F1             = 0x70,
00379 
00381           JK_F2,
00382 
00384           JK_F3,
00385 
00387           JK_F4,
00388 
00390           JK_F5,
00391 
00393           JK_F6,
00394 
00396           JK_F7,
00397 
00399           JK_F8,
00400 
00402           JK_F9,
00403 
00405           JK_F10,
00406 
00408           JK_F11,
00409 
00411           JK_F12, // 0x7B
00412 
00413           JK_7C,
00414           JK_7D,
00415           JK_7E,
00416 
00417           JK_DELETE         = 0x7F, /* ASCII DEL */
00418 
00419           /* For European keyboards */
00421           JK_DEAD_GRAVE     = 0x80,
00423           JK_DEAD_ACUTE,
00425           JK_DEAD_CIRCUMFLEX,
00427           JK_DEAD_TILDE,
00429           JK_DEAD_MACRON,
00431           JK_DEAD_BREVE,
00433           JK_DEAD_ABOVEDOT,
00435           JK_DEAD_DIAERESIS,
00437           JK_DEAD_ABOVERING,
00439           JK_DEAD_DOUBLEACUTE,
00441           JK_DEAD_CARON,
00443           JK_DEAD_CEDILLA,
00445           JK_DEAD_OGONEK,
00447           JK_DEAD_IOTA,
00449           JK_DEAD_VOICED_SOUND,
00451           JK_DEAD_SEMIVOICED_SOUND, // 0x8F
00452 
00453           JK_NUM_LOCK       = 0x90,
00454           JK_SCROLL_LOCK    = 0x91,
00455           JK_92,
00456           JK_93,
00457           JK_94,
00458           JK_95,
00460           JK_AMPERSAND      = 0x96,
00462           JK_ASTERISK       = 0x97,
00464           JK_QUOTEDBL       = 0x98,
00466           JK_LESS           = 0x99,
00467 
00468           JK_PRINTSCREEN    = 0x9A,
00469           JK_INSERT         = 0x9B,
00470           JK_HELP           = 0x9C,
00471           JK_META           = 0x9D,
00472           JK_9E,
00473           JK_9F,
00474 
00476           JK_GREATER        = 0xA0,
00478           JK_BRACELEFT      = 0xA1,
00480           JK_BRACERIGHT     = 0xA2,
00481 
00482           JK_BACK_QUOTE     = 0xC0,
00483           JK_QUOTE          = 0xDE,
00484 
00490           JK_KP_UP          = 0xE0,
00491 
00497           JK_KP_DOWN        = 0xE1,
00498 
00504           JK_KP_LEFT        = 0xE2,
00505 
00511           JK_KP_RIGHT       = 0xE3,
00512 
00517           /* Japanese PC 106 keyboard: eisuu */
00518           JK_ALPHANUMERIC             = 0xF0,
00519  
00524           /* Japanese PC 106 keyboard: katakana */
00525           JK_KATAKANA                 = 0xF1,
00526  
00531           /* Japanese PC 106 keyboard: hiragana */
00532           JK_HIRAGANA                 = 0xF2,
00533  
00538           /* Japanese PC 106 keyboard: zenkaku */
00539           JK_FULL_WIDTH               = 0xF3,
00540  
00545           /* Japanese PC 106 keyboard: hankaku */
00546           JK_HALF_WIDTH               = 0xF4,
00547  
00552           /* Japanese PC 106 keyboard: roumaji */
00553           JK_ROMAN_CHARACTERS         = 0xF5,
00554  
00559           /* Japanese PC 106 keyboard - VK_CONVERT + ALT: zenkouho */
00560           JK_ALL_CANDIDATES           = 0x0100,
00561  
00566           /* Japanese PC 106 keyboard - VK_CONVERT + SHIFT: maekouho */
00567           JK_PREVIOUS_CANDIDATE       = 0x0101,
00568  
00573           /* Japanese PC 106 keyboard - VK_ALPHANUMERIC + ALT: kanji bangou */
00574           JK_CODE_INPUT               = 0x0102,
00575  
00581           /* Japanese Macintosh keyboard - VK_JAPANESE_HIRAGANA + SHIFT */
00582           JK_JAPANESE_KATAKANA        = 0x0103,
00583  
00589           /* Japanese Macintosh keyboard */
00590           JK_JAPANESE_HIRAGANA        = 0x0104,
00591  
00597           /* Japanese Macintosh keyboard */
00598           JK_JAPANESE_ROMAN           = 0x0105,
00599 
00605           /* Japanese PC 106 keyboard with special Windows driver - eisuu + Control; Japanese Solaris keyboard: kana */
00606           JK_KANA_LOCK                = 0x0106,
00607 
00612           /* Japanese PC 106 keyboard: kanji. Japanese Solaris keyboard: nihongo */
00613           JK_INPUT_METHOD_ON_OFF      = 0x0107,
00614 
00619           JK_AT             = 0x0200,
00620  
00625           JK_COLON,
00626  
00631           JK_CIRCUMFLEX,
00632  
00637           JK_DOLLAR,
00638  
00643           JK_EURO_SIGN,
00644  
00649           JK_EXCLAMATION_MARK,
00650  
00655           JK_INVERTED_EXCLAMATION_MARK,
00656  
00661           JK_LEFT_PARENTHESIS,
00662  
00667           JK_NUMBER_SIGN,
00668  
00673           JK_PLUS,
00674  
00679           JK_RIGHT_PARENTHESIS,
00680  
00685           JK_UNDERSCORE, // 0x020B
00686      
00691           /* F13 - F24 are used on IBM 3270 keyboard; use random range for constants. */
00692           JK_F13            = 0xF000,
00693  
00698           JK_F14,
00699  
00704           JK_F15,
00705  
00710           JK_F16,
00711  
00716           JK_F17,
00717  
00722           JK_F18,
00723  
00728           JK_F19,
00729  
00734           JK_F20,
00735  
00740           JK_F21,
00741  
00746           JK_F22,
00747  
00752           JK_F23,
00753  
00758           JK_F24, // 0xF00B
00759  
00764           JK_COMPOSE                  = 0xFF20,
00765  
00770           JK_ALT_GRAPH                = 0xFF7E,
00771           JK_STOP                     = 0xFFC8,
00772           JK_AGAIN                    = 0xFFC9,
00773           JK_PROPS                    = 0xFFCA,
00774           JK_UNDO                     = 0xFFCB,
00775           JK_FFCC                     = 0xFFCC,
00776           JK_COPY                     = 0xFFCD,
00777           JK_FFCE                     = 0xFFCE,
00778           JK_PASTE                    = 0xFFCF,
00779           JK_FIND                     = 0xFFD0,
00780           JK_CUT                      = 0xFFD1,
00781           
00786           CHAR_UNDEFINED   = 0xFFFF,
00787           
00788         };
00789 
00790         KeyEvent();
00791 
00827         KeyEvent
00828           (const Ref<Component>& source, jint id, jlong when, jint modifiers, 
00829            jint keyCode, jchar keyChar, jint keyLocation = KEY_LOCATION_STANDARD);
00830 
00835         virtual void consume();
00836 
00844         virtual jint getKeyCode() const;
00845 
00851         virtual void setKeyCode(jint keyCode);
00852 
00862         virtual jchar getKeyChar() const;
00863 
00870         virtual void setKeyChar(jchar keyChar);
00871 
00884         virtual jint getKeyLocation() const;
00885 
00893         static String getKeyText(jint keyCode);
00894 
00903         virtual jboolean isActionKey() const;
00904 
00911         virtual String paramString() const;
00912 
00913       protected:
00914 
00926         jint  keyCode;
00927 
00937         jchar keyChar;
00938 
00953         jint keyLocation;
00954 
00955       private:
00956 
00957         REGISTER_MEMBERS;
00958 
00959       };
00960 
00961     } // namespace event
00962   } // namespace awt
00963 } // namespace java
00964 
00965 #endif /* JAVA_AWT_EVENT_KEYEVENT_H */

Generated on Fri May 16 11:54:43 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3