1 /*
   2  * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #import <Foundation/Foundation.h>
  27 
  28 #ifndef KeyCodeConverter_CRobotKeyCode_h
  29 #define KeyCodeConverter_CRobotKeyCode_h
  30 
  31 const static int OSX_kVK_ANSI_A                 = 0x00;
  32 const static int OSX_kVK_ANSI_S                 = 0x01;
  33 const static int OSX_kVK_ANSI_D                 = 0x02;
  34 const static int OSX_kVK_ANSI_F                 = 0x03;
  35 const static int OSX_kVK_ANSI_H                 = 0x04;
  36 const static int OSX_kVK_ANSI_G                 = 0x05;
  37 const static int OSX_kVK_ANSI_Z                 = 0x06;
  38 const static int OSX_kVK_ANSI_X                 = 0x07;
  39 const static int OSX_kVK_ANSI_C                 = 0x08;
  40 const static int OSX_kVK_ANSI_V                 = 0x09;
  41 const static int OSX_kVK_ISO_Section            = 0x0A;
  42 const static int OSX_kVK_ANSI_B                 = 0x0B;
  43 const static int OSX_kVK_ANSI_Q                 = 0x0C;
  44 const static int OSX_kVK_ANSI_W                 = 0x0D;
  45 const static int OSX_kVK_ANSI_E                 = 0x0E;
  46 const static int OSX_kVK_ANSI_R                 = 0x0F;
  47 const static int OSX_kVK_ANSI_Y                 = 0x10;
  48 const static int OSX_kVK_ANSI_T                 = 0x11;
  49 const static int OSX_kVK_ANSI_1                 = 0x12;
  50 const static int OSX_kVK_ANSI_2                 = 0x13;
  51 const static int OSX_kVK_ANSI_3                 = 0x14;
  52 const static int OSX_kVK_ANSI_4                 = 0x15;
  53 const static int OSX_kVK_ANSI_6                 = 0x16;
  54 const static int OSX_kVK_ANSI_5                 = 0x17;
  55 const static int OSX_kVK_ANSI_Equal             = 0x18;
  56 const static int OSX_kVK_ANSI_9                 = 0x19;
  57 const static int OSX_kVK_ANSI_7                 = 0x1A;
  58 const static int OSX_kVK_ANSI_Minus             = 0x1B;
  59 const static int OSX_kVK_ANSI_8                 = 0x1C;
  60 const static int OSX_kVK_ANSI_0                 = 0x1D;
  61 const static int OSX_kVK_ANSI_RightBracket      = 0x1E;
  62 const static int OSX_kVK_ANSI_O                 = 0x1F;
  63 const static int OSX_kVK_ANSI_U                 = 0x20;
  64 const static int OSX_kVK_ANSI_LeftBracket       = 0x21;
  65 const static int OSX_kVK_ANSI_I                 = 0x22;
  66 const static int OSX_kVK_ANSI_P                 = 0x23;
  67 const static int OSX_kVK_ANSI_L                 = 0x25;
  68 const static int OSX_kVK_ANSI_J                 = 0x26;
  69 const static int OSX_kVK_ANSI_Quote             = 0x27;
  70 const static int OSX_kVK_ANSI_K                 = 0x28;
  71 const static int OSX_kVK_ANSI_Semicolon         = 0x29;
  72 const static int OSX_kVK_ANSI_Backslash         = 0x2A;
  73 const static int OSX_kVK_ANSI_Comma             = 0x2B;
  74 const static int OSX_kVK_ANSI_Slash             = 0x2C;
  75 const static int OSX_kVK_ANSI_N                 = 0x2D;
  76 const static int OSX_kVK_ANSI_M                 = 0x2E;
  77 const static int OSX_kVK_ANSI_Period            = 0x2F;
  78 const static int OSX_kVK_ANSI_Grave             = 0x32;
  79 const static int OSX_kVK_ANSI_KeypadDecimal     = 0x41;
  80 const static int OSX_kVK_ANSI_KeypadMultiply    = 0x43;
  81 const static int OSX_kVK_ANSI_KeypadPlus        = 0x45;
  82 const static int OSX_kVK_ANSI_KeypadClear       = 0x47;
  83 const static int OSX_kVK_ANSI_KeypadDivide      = 0x4B;
  84 const static int OSX_kVK_ANSI_KeypadEnter       = 0x4C;
  85 const static int OSX_kVK_ANSI_KeypadMinus       = 0x4E;
  86 const static int OSX_kVK_ANSI_KeypadEquals      = 0x51;
  87 const static int OSX_kVK_ANSI_Keypad0           = 0x52;
  88 const static int OSX_kVK_ANSI_Keypad1           = 0x53;
  89 const static int OSX_kVK_ANSI_Keypad2           = 0x54;
  90 const static int OSX_kVK_ANSI_Keypad3           = 0x55;
  91 const static int OSX_kVK_ANSI_Keypad4           = 0x56;
  92 const static int OSX_kVK_ANSI_Keypad5           = 0x57;
  93 const static int OSX_kVK_ANSI_Keypad6           = 0x58;
  94 const static int OSX_kVK_ANSI_Keypad7           = 0x59;
  95 const static int OSX_kVK_ANSI_Keypad8           = 0x5B;
  96 const static int OSX_kVK_ANSI_Keypad9           = 0x5C;
  97 const static int OSX_kVK_Return                 = 0x24;
  98 const static int OSX_kVK_Tab                    = 0x30;
  99 const static int OSX_kVK_Space                  = 0x31;
 100 const static int OSX_Delete                     = 0x33;
 101 const static int OSX_Escape                     = 0x35;
 102 const static int OSX_Command                    = 0x37;
 103 const static int OSX_Shift                      = 0x38;
 104 const static int OSX_CapsLock                   = 0x39;
 105 const static int OSX_Option                     = 0x3A;
 106 const static int OSX_Control                    = 0x3B;
 107 const static int OSX_RightShift                 = 0x3C;
 108 const static int OSX_RightOption                = 0x3D;
 109 const static int OSX_RightControl               = 0x3E;
 110 const static int OSX_Function                   = 0x3F;
 111 const static int OSX_F17                        = 0x40;
 112 const static int OSX_VolumeUp                   = 0x48;
 113 const static int OSX_VolumeDown                 = 0x49;
 114 const static int OSX_Mute                       = 0x4A;
 115 const static int OSX_F18                        = 0x4F;
 116 const static int OSX_F19                        = 0x50;
 117 const static int OSX_F20                        = 0x5A;
 118 const static int OSX_F5                         = 0x60;
 119 const static int OSX_F6                         = 0x61;
 120 const static int OSX_F7                         = 0x62;
 121 const static int OSX_F3                         = 0x63;
 122 const static int OSX_F8                         = 0x64;
 123 const static int OSX_F9                         = 0x65;
 124 const static int OSX_F11                        = 0x67;
 125 const static int OSX_F13                        = 0x69;
 126 const static int OSX_F16                        = 0x6A;
 127 const static int OSX_F14                        = 0x6B;
 128 const static int OSX_F10                        = 0x6D;
 129 const static int OSX_F12                        = 0x6F;
 130 const static int OSX_F15                        = 0x71;
 131 const static int OSX_Help                       = 0x72;
 132 const static int OSX_Home                       = 0x73;
 133 const static int OSX_PageUp                     = 0x74;
 134 const static int OSX_ForwardDelete              = 0x75;
 135 const static int OSX_F4                         = 0x76;
 136 const static int OSX_End                        = 0x77;
 137 const static int OSX_F2                         = 0x78;
 138 const static int OSX_PageDown                   = 0x79;
 139 const static int OSX_F1                         = 0x7A;
 140 const static int OSX_LeftArrow                  = 0x7B;
 141 const static int OSX_RightArrow                 = 0x7C;
 142 const static int OSX_DownArrow                  = 0x7D;
 143 const static int OSX_UpArrow                    = 0x7E;
 144 const static int OSX_Undefined                  = 0x7F;
 145 
 146 @interface CRobotKeyCodeMapping : NSObject {
 147     
 148 }
 149 
 150 @property (readwrite, retain) NSDictionary *javaToMacKeyMap;
 151 
 152 + (CRobotKeyCodeMapping *)sharedInstance ;
 153 - (int)getOSXKeyCodeForJavaKey:(int) javaKey;
 154 
 155 @end
 156 
 157 #endif