Back to index

im-sdk  12.3.91
Classes | Defines | Typedefs | Enumerations | Functions | Variables
KeyMap.c File Reference
#include <ctype.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <X11/Sunkeysym.h>
#include <X11/Xmd.h>

Go to the source code of this file.

Classes

struct  KEYMAP_ENTRY
struct  KEYMAP_ENTRY2

Defines

#define XK_KATAKANA
#define kana_table   1 /* for japanese kana support */
#define java_awt_event_KeyEvent_COMPONENT_EVENT_MASK   1LL
#define java_awt_event_KeyEvent_CONTAINER_EVENT_MASK   2LL
#define java_awt_event_KeyEvent_FOCUS_EVENT_MASK   4LL
#define java_awt_event_KeyEvent_KEY_EVENT_MASK   8LL
#define java_awt_event_KeyEvent_MOUSE_EVENT_MASK   16LL
#define java_awt_event_KeyEvent_MOUSE_MOTION_EVENT_MASK   32LL
#define java_awt_event_KeyEvent_WINDOW_EVENT_MASK   64LL
#define java_awt_event_KeyEvent_ACTION_EVENT_MASK   128LL
#define java_awt_event_KeyEvent_ADJUSTMENT_EVENT_MASK   256LL
#define java_awt_event_KeyEvent_ITEM_EVENT_MASK   512LL
#define java_awt_event_KeyEvent_TEXT_EVENT_MASK   1024LL
#define java_awt_event_KeyEvent_RESERVED_ID_MAX   1999L
#define java_awt_event_KeyEvent_serialVersionUID   -1825314779160409405LL
#define java_awt_event_KeyEvent_COMPONENT_FIRST   100L
#define java_awt_event_KeyEvent_COMPONENT_LAST   103L
#define java_awt_event_KeyEvent_COMPONENT_MOVED   100L
#define java_awt_event_KeyEvent_COMPONENT_RESIZED   101L
#define java_awt_event_KeyEvent_COMPONENT_SHOWN   102L
#define java_awt_event_KeyEvent_COMPONENT_HIDDEN   103L
#define java_awt_event_KeyEvent_serialVersionUID   8101406823902992965LL
#define java_awt_event_KeyEvent_SHIFT_MASK   1L
#define java_awt_event_KeyEvent_CTRL_MASK   2L
#define java_awt_event_KeyEvent_META_MASK   4L
#define java_awt_event_KeyEvent_ALT_MASK   8L
#define java_awt_event_KeyEvent_BUTTON1_MASK   16L
#define java_awt_event_KeyEvent_BUTTON2_MASK   8L
#define java_awt_event_KeyEvent_BUTTON3_MASK   4L
#define java_awt_event_KeyEvent_KEY_FIRST   400L
#define java_awt_event_KeyEvent_KEY_LAST   402L
#define java_awt_event_KeyEvent_KEY_TYPED   400L
#define java_awt_event_KeyEvent_KEY_PRESSED   401L
#define java_awt_event_KeyEvent_KEY_RELEASED   402L
#define java_awt_event_KeyEvent_VK_ENTER   10L
#define java_awt_event_KeyEvent_VK_BACK_SPACE   8L
#define java_awt_event_KeyEvent_VK_TAB   9L
#define java_awt_event_KeyEvent_VK_CANCEL   3L
#define java_awt_event_KeyEvent_VK_CLEAR   12L
#define java_awt_event_KeyEvent_VK_SHIFT   16L
#define java_awt_event_KeyEvent_VK_CONTROL   17L
#define java_awt_event_KeyEvent_VK_ALT   18L
#define java_awt_event_KeyEvent_VK_PAUSE   19L
#define java_awt_event_KeyEvent_VK_CAPS_LOCK   20L
#define java_awt_event_KeyEvent_VK_ESCAPE   27L
#define java_awt_event_KeyEvent_VK_SPACE   32L
#define java_awt_event_KeyEvent_VK_PAGE_UP   33L
#define java_awt_event_KeyEvent_VK_PAGE_DOWN   34L
#define java_awt_event_KeyEvent_VK_END   35L
#define java_awt_event_KeyEvent_VK_HOME   36L
#define java_awt_event_KeyEvent_VK_LEFT   37L
#define java_awt_event_KeyEvent_VK_UP   38L
#define java_awt_event_KeyEvent_VK_RIGHT   39L
#define java_awt_event_KeyEvent_VK_DOWN   40L
#define java_awt_event_KeyEvent_VK_COMMA   44L
#define java_awt_event_KeyEvent_VK_PERIOD   46L
#define java_awt_event_KeyEvent_VK_MINUS   0x2D
#define java_awt_event_KeyEvent_VK_SLASH   47L
#define java_awt_event_KeyEvent_VK_0   48L
#define java_awt_event_KeyEvent_VK_1   49L
#define java_awt_event_KeyEvent_VK_2   50L
#define java_awt_event_KeyEvent_VK_3   51L
#define java_awt_event_KeyEvent_VK_4   52L
#define java_awt_event_KeyEvent_VK_5   53L
#define java_awt_event_KeyEvent_VK_6   54L
#define java_awt_event_KeyEvent_VK_7   55L
#define java_awt_event_KeyEvent_VK_8   56L
#define java_awt_event_KeyEvent_VK_9   57L
#define java_awt_event_KeyEvent_VK_SEMICOLON   59L
#define java_awt_event_KeyEvent_VK_EQUALS   61L
#define java_awt_event_KeyEvent_VK_A   65L
#define java_awt_event_KeyEvent_VK_B   66L
#define java_awt_event_KeyEvent_VK_C   67L
#define java_awt_event_KeyEvent_VK_D   68L
#define java_awt_event_KeyEvent_VK_E   69L
#define java_awt_event_KeyEvent_VK_F   70L
#define java_awt_event_KeyEvent_VK_G   71L
#define java_awt_event_KeyEvent_VK_H   72L
#define java_awt_event_KeyEvent_VK_I   73L
#define java_awt_event_KeyEvent_VK_J   74L
#define java_awt_event_KeyEvent_VK_K   75L
#define java_awt_event_KeyEvent_VK_L   76L
#define java_awt_event_KeyEvent_VK_M   77L
#define java_awt_event_KeyEvent_VK_N   78L
#define java_awt_event_KeyEvent_VK_O   79L
#define java_awt_event_KeyEvent_VK_P   80L
#define java_awt_event_KeyEvent_VK_Q   81L
#define java_awt_event_KeyEvent_VK_R   82L
#define java_awt_event_KeyEvent_VK_S   83L
#define java_awt_event_KeyEvent_VK_T   84L
#define java_awt_event_KeyEvent_VK_U   85L
#define java_awt_event_KeyEvent_VK_V   86L
#define java_awt_event_KeyEvent_VK_W   87L
#define java_awt_event_KeyEvent_VK_X   88L
#define java_awt_event_KeyEvent_VK_Y   89L
#define java_awt_event_KeyEvent_VK_Z   90L
#define java_awt_event_KeyEvent_VK_OPEN_BRACKET   91L
#define java_awt_event_KeyEvent_VK_BACK_SLASH   92L
#define java_awt_event_KeyEvent_VK_CLOSE_BRACKET   93L
#define java_awt_event_KeyEvent_VK_NUMPAD0   96L
#define java_awt_event_KeyEvent_VK_NUMPAD1   97L
#define java_awt_event_KeyEvent_VK_NUMPAD2   98L
#define java_awt_event_KeyEvent_VK_NUMPAD3   99L
#define java_awt_event_KeyEvent_VK_NUMPAD4   100L
#define java_awt_event_KeyEvent_VK_NUMPAD5   101L
#define java_awt_event_KeyEvent_VK_NUMPAD6   102L
#define java_awt_event_KeyEvent_VK_NUMPAD7   103L
#define java_awt_event_KeyEvent_VK_NUMPAD8   104L
#define java_awt_event_KeyEvent_VK_NUMPAD9   105L
#define java_awt_event_KeyEvent_VK_MULTIPLY   106L
#define java_awt_event_KeyEvent_VK_ADD   107L
#define java_awt_event_KeyEvent_VK_SEPARATER   108L
#define java_awt_event_KeyEvent_VK_SUBTRACT   109L
#define java_awt_event_KeyEvent_VK_DECIMAL   110L
#define java_awt_event_KeyEvent_VK_DIVIDE   111L
#define java_awt_event_KeyEvent_VK_F1   112L
#define java_awt_event_KeyEvent_VK_F2   113L
#define java_awt_event_KeyEvent_VK_F3   114L
#define java_awt_event_KeyEvent_VK_F4   115L
#define java_awt_event_KeyEvent_VK_F5   116L
#define java_awt_event_KeyEvent_VK_F6   117L
#define java_awt_event_KeyEvent_VK_F7   118L
#define java_awt_event_KeyEvent_VK_F8   119L
#define java_awt_event_KeyEvent_VK_F9   120L
#define java_awt_event_KeyEvent_VK_F10   121L
#define java_awt_event_KeyEvent_VK_F11   122L
#define java_awt_event_KeyEvent_VK_F12   123L
#define java_awt_event_KeyEvent_VK_DELETE   127L
#define java_awt_event_KeyEvent_VK_NUM_LOCK   144L
#define java_awt_event_KeyEvent_VK_SCROLL_LOCK   145L
#define java_awt_event_KeyEvent_VK_PRINTSCREEN   154L
#define java_awt_event_KeyEvent_VK_INSERT   155L
#define java_awt_event_KeyEvent_VK_HELP   156L
#define java_awt_event_KeyEvent_VK_META   157L
#define java_awt_event_KeyEvent_VK_BACK_QUOTE   192L
#define java_awt_event_KeyEvent_VK_QUOTE   222L
#define java_awt_event_KeyEvent_VK_FINAL   24L
#define java_awt_event_KeyEvent_VK_CONVERT   28L
#define java_awt_event_KeyEvent_VK_NONCONVERT   29L
#define java_awt_event_KeyEvent_VK_ACCEPT   30L
#define java_awt_event_KeyEvent_VK_MODECHANGE   31L
#define java_awt_event_KeyEvent_VK_KANA   21L
#define java_awt_event_KeyEvent_VK_KANJI   25L
#define java_awt_event_KeyEvent_VK_UNDEFINED   0L
#define java_awt_event_KeyEvent_CHAR_UNDEFINED   0L
#define java_awt_event_KeyEvent_VK_CUT   0xFFD1
#define java_awt_event_KeyEvent_VK_COPY   0xFFCD
#define java_awt_event_KeyEvent_VK_PASTE   0xFFCF
#define java_awt_event_KeyEvent_VK_UNDO   0xFFCB
#define java_awt_event_KeyEvent_VK_AGAIN   0xFFC9
#define java_awt_event_KeyEvent_VK_FIND   0xFFD0
#define java_awt_event_KeyEvent_VK_PROPS   0xFFCA
#define java_awt_event_KeyEvent_VK_STOP   0xFFC8
#define java_awt_event_KeyEvent_VK_AT   0x0200
#define java_awt_event_InputEvent_SHIFT_MASK   1L
#define java_awt_event_InputEvent_CTRL_MASK   2L
#define java_awt_event_InputEvent_META_MASK   4L
#define java_awt_event_InputEvent_ALT_MASK   8L
#define java_awt_event_InputEvent_BUTTON1_MASK   16L
#define java_awt_event_InputEvent_BUTTON2_MASK   8L
#define java_awt_event_InputEvent_BUTTON3_MASK   4L

Typedefs

typedef struct KEYMAP_ENTRY KeymapEntry
typedef struct KEYMAP_ENTRY2 KeymapEntry2
typedef unsigned short unicode

Enumerations

enum  bool_t {
  FALSE = 0, TRUE = 1, FALSE = 0, TRUE = 1,
  FALSE = 0, TRUE = 1
}

Functions

static KeySym getX11KeySym (long awtKey)
static long getAWTKeyCode (long keysym)
static void getAWTKeyCode2 (long keysym, int *keycode, int *keychar)
static void set_mod_mask (int modnum, int *mask)
static void setup_modifier_map (Display *disp)
static void modify_Event (XEvent *xevent, long keyCode, unicode keyChar, long modifiers)
void VirtualKeyToXKeyEvent (CARD32 keyCode, CARD32 keyChar, CARD32 state, XKeyEvent *kev)
Bool KeyEventToVirtualKey (XKeyEvent *ev, int *keycode_ret, int *keychar_ret, int *state_ret)

Variables

static int awt_MetaMask = 0
static int awt_AltMask = 0
static int awt_NumLockMask = 0
static int awt_KanaLockMask = 0
static KeymapEntry2 kana_normal_keymapTable []
static KeymapEntry2 kana_shift_keymapTable []
static KeymapEntry keymapTable []
static long keyCode_XK_Delete = 0
static int first_call = True

Class Documentation

struct KEYMAP_ENTRY

Definition at line 59 of file KeyMap.c.

Class Members
long awtKey
Bool printable
KeySym x11Key
struct KEYMAP_ENTRY2

Definition at line 66 of file KeyMap.c.

Class Members
KeySym alt_x11Key
long awtKey
int keychar
KeyCode keycode
Bool printable
KeySym x11Key

Define Documentation

Definition at line 367 of file KeyMap.c.

Definition at line 369 of file KeyMap.c.

Definition at line 371 of file KeyMap.c.

Definition at line 373 of file KeyMap.c.

Definition at line 363 of file KeyMap.c.

Definition at line 365 of file KeyMap.c.

Definition at line 361 of file KeyMap.c.

Definition at line 68 of file KeyMap.c.

Definition at line 70 of file KeyMap.c.

Definition at line 100 of file KeyMap.c.

Definition at line 102 of file KeyMap.c.

Definition at line 104 of file KeyMap.c.

Definition at line 106 of file KeyMap.c.

Definition at line 338 of file KeyMap.c.

Definition at line 54 of file KeyMap.c.

Definition at line 80 of file KeyMap.c.

Definition at line 90 of file KeyMap.c.

Definition at line 82 of file KeyMap.c.

Definition at line 84 of file KeyMap.c.

Definition at line 86 of file KeyMap.c.

Definition at line 88 of file KeyMap.c.

Definition at line 56 of file KeyMap.c.

Definition at line 96 of file KeyMap.c.

Definition at line 58 of file KeyMap.c.

Definition at line 72 of file KeyMap.c.

Definition at line 60 of file KeyMap.c.

Definition at line 108 of file KeyMap.c.

Definition at line 110 of file KeyMap.c.

Definition at line 114 of file KeyMap.c.

Definition at line 116 of file KeyMap.c.

Definition at line 112 of file KeyMap.c.

Definition at line 98 of file KeyMap.c.

Definition at line 62 of file KeyMap.c.

Definition at line 64 of file KeyMap.c.

Definition at line 76 of file KeyMap.c.

#define java_awt_event_KeyEvent_serialVersionUID   -1825314779160409405LL

Definition at line 92 of file KeyMap.c.

#define java_awt_event_KeyEvent_serialVersionUID   8101406823902992965LL

Definition at line 92 of file KeyMap.c.

Definition at line 94 of file KeyMap.c.

Definition at line 74 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_0   48L

Definition at line 166 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_1   49L

Definition at line 168 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_2   50L

Definition at line 170 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_3   51L

Definition at line 172 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_4   52L

Definition at line 174 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_5   53L

Definition at line 176 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_6   54L

Definition at line 178 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_7   55L

Definition at line 180 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_8   56L

Definition at line 182 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_9   57L

Definition at line 184 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_A   65L

Definition at line 190 of file KeyMap.c.

Definition at line 328 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_ADD   107L

Definition at line 270 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_AGAIN   0xFFC9

Definition at line 349 of file KeyMap.c.

Definition at line 132 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_AT   0x0200

Definition at line 358 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_B   66L

Definition at line 192 of file KeyMap.c.

Definition at line 318 of file KeyMap.c.

Definition at line 244 of file KeyMap.c.

Definition at line 120 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_C   67L

Definition at line 194 of file KeyMap.c.

Definition at line 124 of file KeyMap.c.

Definition at line 136 of file KeyMap.c.

Definition at line 126 of file KeyMap.c.

Definition at line 246 of file KeyMap.c.

Definition at line 158 of file KeyMap.c.

Definition at line 130 of file KeyMap.c.

Definition at line 324 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_COPY   0xFFCD

Definition at line 343 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_CUT   0xFFD1

Definition at line 341 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_D   68L

Definition at line 196 of file KeyMap.c.

Definition at line 276 of file KeyMap.c.

Definition at line 304 of file KeyMap.c.

Definition at line 278 of file KeyMap.c.

Definition at line 156 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_E   69L

Definition at line 198 of file KeyMap.c.

Definition at line 146 of file KeyMap.c.

Definition at line 118 of file KeyMap.c.

Definition at line 188 of file KeyMap.c.

Definition at line 138 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_F   70L

Definition at line 200 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_F1   112L

Definition at line 280 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_F10   121L

Definition at line 298 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_F11   122L

Definition at line 300 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_F12   123L

Definition at line 302 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_F2   113L

Definition at line 282 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_F3   114L

Definition at line 284 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_F4   115L

Definition at line 286 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_F5   116L

Definition at line 288 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_F6   117L

Definition at line 290 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_F7   118L

Definition at line 292 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_F8   119L

Definition at line 294 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_F9   120L

Definition at line 296 of file KeyMap.c.

Definition at line 322 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_FIND   0xFFD0

Definition at line 351 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_G   71L

Definition at line 202 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_H   72L

Definition at line 204 of file KeyMap.c.

Definition at line 314 of file KeyMap.c.

Definition at line 148 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_I   73L

Definition at line 206 of file KeyMap.c.

Definition at line 312 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_J   74L

Definition at line 208 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_K   75L

Definition at line 210 of file KeyMap.c.

Definition at line 332 of file KeyMap.c.

Definition at line 334 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_L   76L

Definition at line 212 of file KeyMap.c.

Definition at line 150 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_M   77L

Definition at line 214 of file KeyMap.c.

Definition at line 316 of file KeyMap.c.

Definition at line 162 of file KeyMap.c.

Definition at line 330 of file KeyMap.c.

Definition at line 268 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_N   78L

Definition at line 216 of file KeyMap.c.

Definition at line 326 of file KeyMap.c.

Definition at line 306 of file KeyMap.c.

Definition at line 248 of file KeyMap.c.

Definition at line 250 of file KeyMap.c.

Definition at line 252 of file KeyMap.c.

Definition at line 254 of file KeyMap.c.

Definition at line 256 of file KeyMap.c.

Definition at line 258 of file KeyMap.c.

Definition at line 260 of file KeyMap.c.

Definition at line 262 of file KeyMap.c.

Definition at line 264 of file KeyMap.c.

Definition at line 266 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_O   79L

Definition at line 218 of file KeyMap.c.

Definition at line 242 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_P   80L

Definition at line 220 of file KeyMap.c.

Definition at line 144 of file KeyMap.c.

Definition at line 142 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_PASTE   0xFFCF

Definition at line 345 of file KeyMap.c.

Definition at line 134 of file KeyMap.c.

Definition at line 160 of file KeyMap.c.

Definition at line 310 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_PROPS   0xFFCA

Definition at line 353 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_Q   81L

Definition at line 222 of file KeyMap.c.

Definition at line 320 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_R   82L

Definition at line 224 of file KeyMap.c.

Definition at line 154 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_S   83L

Definition at line 226 of file KeyMap.c.

Definition at line 308 of file KeyMap.c.

Definition at line 186 of file KeyMap.c.

Definition at line 272 of file KeyMap.c.

Definition at line 128 of file KeyMap.c.

Definition at line 164 of file KeyMap.c.

Definition at line 140 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_STOP   0xFFC8

Definition at line 355 of file KeyMap.c.

Definition at line 274 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_T   84L

Definition at line 228 of file KeyMap.c.

Definition at line 122 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_U   85L

Definition at line 230 of file KeyMap.c.

Definition at line 336 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_UNDO   0xFFCB

Definition at line 347 of file KeyMap.c.

Definition at line 152 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_V   86L

Definition at line 232 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_W   87L

Definition at line 234 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_X   88L

Definition at line 236 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_Y   89L

Definition at line 238 of file KeyMap.c.

#define java_awt_event_KeyEvent_VK_Z   90L

Definition at line 240 of file KeyMap.c.

Definition at line 66 of file KeyMap.c.

#define kana_table   1 /* for japanese kana support */

Definition at line 20 of file KeyMap.c.

#define XK_KATAKANA

Definition at line 6 of file KeyMap.c.


Typedef Documentation

typedef struct KEYMAP_ENTRY KeymapEntry
typedef struct KEYMAP_ENTRY2 KeymapEntry2
typedef unsigned short unicode

Definition at line 380 of file KeyMap.c.


Enumeration Type Documentation

enum bool_t
Enumerator:
FALSE 
TRUE 
FALSE 
TRUE 
FALSE 
TRUE 

Definition at line 375 of file KeyMap.c.

                   {
    FALSE = 0,
    TRUE = 1
} bool_t;

Function Documentation

static long getAWTKeyCode ( long  keysym) [static]

Definition at line 643 of file KeyMap.c.

{
    int i;
    for (i = 0; keymapTable[i].awtKey != 0; i++) {
        if (keymapTable[i].x11Key == keysym) {
         return keymapTable[i].awtKey;
        }
    }
    return 0;
}

Here is the caller graph for this function:

static void getAWTKeyCode2 ( long  keysym,
int *  keycode,
int *  keychar 
) [static]

Definition at line 656 of file KeyMap.c.

{
    int i;
         *keycode = 0;
         *keychar = 0;

    for (i = 0; kana_normal_keymapTable[i].awtKey != 0; i++) {
        if (kana_normal_keymapTable[i].x11Key == keysym) {
         *keycode = kana_normal_keymapTable[i].awtKey;
         *keychar = kana_normal_keymapTable[i].keychar;
         return;
        }
    }
    for (i = 0; kana_shift_keymapTable[i].awtKey != 0; i++) {
        if (kana_shift_keymapTable[i].x11Key == keysym) {
         *keycode = kana_shift_keymapTable[i].awtKey;
         *keychar = kana_shift_keymapTable[i].keychar;
         return;
        }
    }
    return;
}

Here is the caller graph for this function:

static KeySym getX11KeySym ( long  awtKey) [static]

Definition at line 628 of file KeyMap.c.

{
    int i;
    for (i = 0; keymapTable[i].awtKey != 0; i++) {
        if (keymapTable[i].awtKey == awtKey) {
         /* stop checking printable or not, otherwise
            arrow keys won't work
           if (keymapTable[i].printable == FALSE) return 0;
           */
         return keymapTable[i].x11Key;
        }
    }
    return 0;
}

Here is the caller graph for this function:

Bool KeyEventToVirtualKey ( XKeyEvent *  ev,
int *  keycode_ret,
int *  keychar_ret,
int *  state_ret 
)

Definition at line 982 of file KeyMap.c.

                                                     {
  KeySym keysym;
  char buf[64];
  int len = sizeof(buf);
  int state;
  int i;

  *keychar_ret = 0;
  *keycode_ret = 0;

  if (first_call && ev->display != (Display*)0) {
     setup_modifier_map(ev->display);
  }
  first_call = False;

  state = ev->state;

  /* LockMask, NumLockMask, KanaLockMask should be ignored for
     Java Client compatibility */
  if(state & LockMask){
    state -= LockMask;
  }
  if(state & awt_NumLockMask){
    state -= awt_NumLockMask;
  }
  if(state & awt_KanaLockMask){
    state -= awt_KanaLockMask;
  }

  /* IIIMP's control_mask(1<<1) and X's control_mask(1<<2)is
       different, so it should be changed */
  if (state & ControlMask) {
    state -= (1<<2);
    state |= (1<<1);
  }

  *state_ret = state;

  len = XLookupString(ev, buf, len - 1, &keysym, NULL);

#ifdef  linux
   /* Linux generates XK_Mode_switch at Shift + Henkan_Mode */
   if (getenv("HTT_USES_LINUX_XKEYSYM")&&
        ((state & ShiftMask) && keysym == XK_Mode_switch)){
        keysym = XK_Henkan_Mode;
   } else
#endif /* linux */
  if (IsModifierKey(keysym)) {
       return False;
  }

#ifdef linux
  if (KanaMode != -1){
       if (keysym == XK_Hiragana_Katakana){
#ifdef DEBUG
              printf("Kanakey is pressed\n");
#endif
              if (KanaMode == 1){
                     KanaMode = 0;
#ifdef DEBUG
              printf("      off\n");
#endif
              } else {
                     KanaMode = 1;
#ifdef DEBUG
              printf("      on\n");
#endif
              }
              XChangeProperty(ev->display, kana_w, kanaflag_atom,
                            XA_WINDOW, 32,
                            PropModeReplace,
                            &KanaMode, sizeof(KanaMode));
              return False;
       }
  }

  if (KanaMode != -1){
       GetKanaFlag(ev->display);
  }     

  if (KanaMode == 1) {
       if (ev->state & ShiftMask) {
              /* check kana_shift_keymapTable first is ShiftMask */
              for (i = 0; kana_shift_keymapTable[i].awtKey != 0; i++) {
                     if (kana_shift_keymapTable[i].keycode == ev->keycode) {
                            getAWTKeyCode2(kana_shift_keymapTable[i].x11Key, keycode_ret, keychar_ret);
                            if (*keycode_ret) {
                                   return True;
                            }
                            break;
                     }
              }
       }

       for (i = 0; kana_normal_keymapTable[i].awtKey != 0; i++) {
              if (kana_normal_keymapTable[i].keycode == ev->keycode) {
                     getAWTKeyCode2(kana_normal_keymapTable[i].x11Key, keycode_ret, keychar_ret);
                     if (*keycode_ret) {
                            return True;
                     }
                     break;
              }
       }

       for (i = 0; kana_shift_keymapTable[i].awtKey != 0; i++) {
              if (kana_shift_keymapTable[i].keycode == ev->keycode) {
                     getAWTKeyCode2(kana_shift_keymapTable[i].x11Key, keycode_ret, keychar_ret);
                     if (*keycode_ret) {
                            return True;
                     }
                     break;
              }
       }
   }
#endif /* linux */

  /* store keycode for XK_Delete */
  if(keysym == XK_Delete && keyCode_XK_Delete == 0){
       keyCode_XK_Delete = ev->keycode;
  }

  if (keysym < 256) {
    if ((ev->state & ControlMask)) {
       if (isalpha(keysym)) {
         keysym = toupper(keysym);
       }
    }
    *keycode_ret = getAWTKeyCode(keysym);
    if (*keycode_ret == 0 && (ev->state & ShiftMask)) {
       /* when Shift key is pressed, need to get the normal keysym,
          then get the AWT keycode */
       if (ev->display != (Display*)0) {
          *keycode_ret = getAWTKeyCode(XKeycodeToKeysym(ev->display,
                                                 ev->keycode, 0));
       }
    }
    if (*keycode_ret == 0) {
        *keycode_ret = keysym;
    }
    *keychar_ret = keysym;
    return True;
  } else {
    *keycode_ret = getAWTKeyCode(keysym);
    switch (keysym) {
    case XK_KP_Decimal:
      *keychar_ret = '.';
      break;
    case XK_KP_Add:
      *keychar_ret = '+';
      break;
    case XK_KP_Subtract:
      *keychar_ret = '-';
      break;
    case XK_KP_Divide:
      *keychar_ret = '/';
      break;
    case XK_KP_Multiply:
      *keychar_ret = '*';
      break;
    case XK_KP_0:
      *keychar_ret = '0';
      break;
    case XK_KP_1:
      *keychar_ret = '1';
      break;
    case XK_KP_2:
      *keychar_ret = '2';
      break;
    case XK_KP_3:
      *keychar_ret = '3';
      break;
    case XK_KP_4:
      *keychar_ret = '4';
      break;
    case XK_KP_5:
      *keychar_ret = '5';
      break;
    case XK_KP_6:
      *keychar_ret = '6';
      break;
    case XK_KP_7:
      *keychar_ret = '7';
      break;
    case XK_KP_8:
      *keychar_ret = '8';
      break;
    case XK_KP_9:
      *keychar_ret = '9';
      break;
    }
    if(*keycode_ret) {
        return True;
    }

    /* get Kana code */
    getAWTKeyCode2(keysym, keycode_ret, keychar_ret);

    if (*keycode_ret) {
        return True;
    }

    if (*keycode_ret == 0 && (ev->state & ShiftMask)) {
        /* when Shift key is pressed, need to get the normal keysym,
          then get the AWT keycode */
       *keycode_ret = getAWTKeyCode(XKeycodeToKeysym(ev->display,
                                                 ev->keycode, 0));
    }

    if (*keycode_ret) {
        return True;
    }
  }
  return False;
}

Here is the call graph for this function:

static void modify_Event ( XEvent *  xevent,
long  keyCode,
unicode  keyChar,
long  modifiers 
) [static]

Definition at line 844 of file KeyMap.c.

{
    KeySym keysym = 0;

    if (xevent->type != KeyPress && xevent->type != KeyRelease)
        return;

    switch(keyCode) {
      case java_awt_event_KeyEvent_VK_ENTER:
      case java_awt_event_KeyEvent_VK_BACK_SPACE:
      case java_awt_event_KeyEvent_VK_TAB:
      case java_awt_event_KeyEvent_VK_ESCAPE:
      case java_awt_event_KeyEvent_VK_MULTIPLY:
      case java_awt_event_KeyEvent_VK_ADD:
      case java_awt_event_KeyEvent_VK_SUBTRACT:
      case java_awt_event_KeyEvent_VK_DIVIDE:
      case java_awt_event_KeyEvent_VK_EQUALS:
      case java_awt_event_KeyEvent_VK_DECIMAL:
          keysym = getX11KeySym(keyCode);
          break;
      default:
          if ((keyChar != 0 && keyChar < 256)
             || (keyChar >= 0xff61 && keyChar <= 0xff9f)) {
              keysym = keyChar;
          } else {
              keysym = getX11KeySym(keyCode);
          }
          break;
    }

    if (keysym != 0) {
       if (modifiers & java_awt_event_InputEvent_CTRL_MASK) {
           switch (keysym + 64) {
             case '[':
             case ']':
             case '\\':
             case '_':
              keysym += 64;
              break;
             default:
              if (keysym < 254) {
                if (modifiers & java_awt_event_InputEvent_SHIFT_MASK) {
                  if (isalpha(keysym + 'A' - 1)) {
                    keysym += ('A' - 1);
                  }
                } else {
                  if (isalpha(keysym + 'a' - 1)) {
                    keysym += ('a' - 1);
                  }
                }
              }
              break;
           }
       }

       /*
        * 0xff61 is Unicode value of first XK_kana_fullstop.
        * We need X Keysym to Unicode map in post1.1 release
        * to support more intenational keyboard.
        */
       /*
        * 0xff63 is duplicate with INSERT
        */
       if (keyCode != java_awt_event_KeyEvent_VK_INSERT &&
           keyCode != java_awt_event_KeyEvent_VK_ACCEPT &&
           keyCode != java_awt_event_KeyEvent_VK_ENTER &&
           (keysym >= 0xff61 && keysym <= 0xff9f)) {
           keysym = keysym - 0xff61 + XK_kana_fullstop;

           /*
            * modifier needs to be set
            */
           xevent->xkey.state |= awt_KanaLockMask;
       }

       /* workaround, do we have to set NumLock mask for
          all KP_ keysym??? */
       if(keysym == XK_KP_Decimal){
           xevent->xkey.state |= awt_NumLockMask;
        }

       if (xevent->xany.display)
           xevent->xkey.keycode = XKeysymToKeycode(xevent->xany.display,
                                              keysym);
       else
           xevent->xkey.keycode = keysym; /* hack */

       /* workaround for XKeysymToKeycode() */
       if (keyCode == java_awt_event_KeyEvent_VK_DELETE){
           xevent->xkey.keycode = keyCode_XK_Delete;
       }
    }

    if (keysym >= 'A' && keysym <= 'Z') {
       xevent->xkey.state |= ShiftMask;
    }
    if (modifiers & java_awt_event_InputEvent_SHIFT_MASK) {
       xevent->xkey.state |= ShiftMask;
    }
    if (modifiers & java_awt_event_InputEvent_CTRL_MASK) {
       xevent->xkey.state |= ControlMask;
    }
    if (modifiers & java_awt_event_InputEvent_META_MASK) {
       xevent->xkey.state |= awt_MetaMask;
    }
    if (modifiers & java_awt_event_InputEvent_ALT_MASK) {
       xevent->xkey.state |= awt_AltMask;
    }
    if (modifiers & java_awt_event_InputEvent_BUTTON1_MASK) {
        xevent->xkey.state |= Button1Mask;
    }
    if (modifiers & java_awt_event_InputEvent_BUTTON2_MASK) {
        xevent->xkey.state |= Button2Mask;
    }
    if (modifiers & java_awt_event_InputEvent_BUTTON3_MASK) {
        xevent->xkey.state |= Button3Mask;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void set_mod_mask ( int  modnum,
int *  mask 
) [static]

Definition at line 681 of file KeyMap.c.

                                    {
    switch(modnum) {
      case 1: 
       *mask = Mod1Mask;
       break;               
      case 2: 
       *mask = Mod2Mask;
       break;        
      case 3: 
       *mask = Mod3Mask;
       break;               
      case 4: 
       *mask = Mod4Mask;
       break; 
      case 5:
       *mask = Mod5Mask;
       break;
      default:
       *mask = 0;
    }
}

Here is the caller graph for this function:

static void setup_modifier_map ( Display *  disp) [static]

Definition at line 704 of file KeyMap.c.

{
    XModifierKeymap *modmap; 
    int i, k, nkeys;
    KeyCode keycode, metaL, metaR, altL, altR, numLock, Mode_switch;

    metaL = XKeysymToKeycode(disp, XK_Meta_L);
    metaR = XKeysymToKeycode(disp, XK_Meta_R);
    altR = XKeysymToKeycode(disp, XK_Alt_R);
    altL = XKeysymToKeycode(disp, XK_Alt_L);
    numLock = XKeysymToKeycode(disp, XK_Num_Lock);
    Mode_switch = XKeysymToKeycode(disp, XK_Mode_switch);

    modmap = XGetModifierMapping(disp);
    nkeys = modmap->max_keypermod;
    for(i = 3*nkeys; 
       i < (nkeys*8) && (awt_MetaMask == 0 || awt_AltMask == 0 || awt_NumLockMask == 0 || awt_KanaLockMask ==0);
            i++) {
       keycode = modmap->modifiermap[i];
       k = (i/nkeys) - 2;
       if (awt_MetaMask == 0 && (keycode == metaL || keycode == metaR)) {
           set_mod_mask(k, &awt_MetaMask);
       } else if (awt_AltMask == 0 && (keycode == altL || keycode == altR)) {
           set_mod_mask(k, &awt_AltMask);
       } else if (awt_NumLockMask == 0 && keycode == numLock) {
            set_mod_mask(k, &awt_NumLockMask);
       } else if (awt_KanaLockMask == 0 && keycode == Mode_switch) {
            set_mod_mask(k, &awt_KanaLockMask);
        }
    }
    XFreeModifiermap(modmap);

#ifdef linux
    /* hack for Linux XFree86 */
    if (getenv("HTT_USES_LINUX_XKEYSYM")){
           for (i = 0; keymapTable[i].awtKey != 0; i++) {
              if (keymapTable[i].x11Key == XK_Henkan_Mode) {
                keymapTable[i].x11Key = XK_Zenkaku_Hankaku;
                break;
              }
           }
           for (i = 0; keymapTable[i].awtKey != 0; i++) {
              if (keymapTable[i].x11Key == XK_Kanji) {
                keymapTable[i].x11Key = XK_Henkan_Mode;
                break;
              }
           }
           for (i = 0; keymapTable[i].awtKey != 0; i++) {
              if (keymapTable[i].x11Key == XK_Execute) {
                keymapTable[i].x11Key = XK_Muhenkan;
                break;
              }
           }
    }

    /* hack for Linux XFree86 */
    if (getenv("HTT_GENERATES_KANAKEY")){
       KanaMode = 0;
    } else {
       return;
    }

    /* Get Keycodes for Kana keys */
    for (i = 0; kana_normal_keymapTable[i].awtKey != 0; i++) {
       kana_normal_keymapTable[i].keycode = XKeysymToKeycode(disp,
                                          kana_normal_keymapTable[i].x11Key);
       if (kana_normal_keymapTable[i].keycode == 0) {
              kana_normal_keymapTable[i].keycode = XKeysymToKeycode(disp,
                                          kana_normal_keymapTable[i].alt_x11Key);
       }
#ifdef DEBUG
       printf("xkey=%x(%x) -> %x\n", kana_normal_keymapTable[i].x11Key,
                                   kana_normal_keymapTable[i].keychar,
                                   kana_normal_keymapTable[i].keycode);
#endif
    }
    for (i = 0; kana_shift_keymapTable[i].awtKey != 0; i++) {
       kana_shift_keymapTable[i].keycode = XKeysymToKeycode(disp,
                                          kana_shift_keymapTable[i].x11Key);
       if (kana_shift_keymapTable[i].keycode == 0) {
              kana_shift_keymapTable[i].keycode = XKeysymToKeycode(disp,
                                          kana_shift_keymapTable[i].alt_x11Key);
       }
#ifdef DEBUG
       printf("xkey=%x(%x) -> %x\n", kana_shift_keymapTable[i].x11Key,
                                   kana_shift_keymapTable[i].keychar,
                                   kana_shift_keymapTable[i].keycode);
#endif
    }

    if (!kanawin_atom) {
       kanawin_atom = XInternAtom(disp, "HTT_KANA_WIN", False);
       kanaflag_atom = XInternAtom(disp, "HTT_KANA_FLAG", False);
    }

    kana_w = XGetSelectionOwner(disp, kanawin_atom);

    if (kana_w == None) {
       kana_w = XCreateSimpleWindow(disp, RootWindow(disp, 0),
                     0, 0, 1, 1, 0, 0, 0);

       XSetSelectionOwner(disp, kanawin_atom, kana_w, CurrentTime);

       XChangeProperty(disp, kana_w, kanaflag_atom, XA_WINDOW, 32,
                            PropModeReplace,
                            &KanaMode, sizeof(KanaMode));
    }

    GetKanaFlag(disp);
#endif /* linux */
}

Here is the call graph for this function:

Here is the caller graph for this function:

void VirtualKeyToXKeyEvent ( CARD32  keyCode,
CARD32  keyChar,
CARD32  state,
XKeyEvent *  kev 
)

Definition at line 966 of file KeyMap.c.

                                                  {

    if (first_call && kev->display != (Display*)0) {
       setup_modifier_map(kev->display);
    }
    first_call = False;
    modify_Event((XEvent*)kev, keyCode, keyChar, state);
    return;
}

Here is the call graph for this function:


Variable Documentation

int awt_AltMask = 0 [static]

Definition at line 40 of file KeyMap.c.

int awt_KanaLockMask = 0 [static]

Definition at line 42 of file KeyMap.c.

int awt_MetaMask = 0 [static]

Definition at line 39 of file KeyMap.c.

int awt_NumLockMask = 0 [static]

Definition at line 41 of file KeyMap.c.

int first_call = True [static]

Definition at line 963 of file KeyMap.c.

Definition at line 383 of file KeyMap.c.

Initial value:
 {
    { java_awt_event_KeyEvent_VK_3, XK_kana_a, XK_numbersign, 0xff67, TRUE, 0 },
    { java_awt_event_KeyEvent_VK_4, XK_kana_u, XK_dollar, 0xff69, TRUE, 0 },
    { java_awt_event_KeyEvent_VK_5, XK_kana_e, XK_percent, 0xff6a, TRUE, 0 },
    { java_awt_event_KeyEvent_VK_6, XK_kana_o, XK_ampersand, 0xff6b, TRUE, 0 },
    { java_awt_event_KeyEvent_VK_7, XK_kana_ya, XK_apostrophe, 0xff6c, TRUE, 0 },
    { java_awt_event_KeyEvent_VK_8, XK_kana_yu, XK_parenleft, 0xff6d, TRUE, 0 },
    { java_awt_event_KeyEvent_VK_9, XK_kana_yo, XK_parenright, 0xff6e, TRUE, 0 },
    { java_awt_event_KeyEvent_VK_0, XK_kana_WO, XK_asciitilde, 0xff66, TRUE, 0 },
    { java_awt_event_KeyEvent_VK_E, XK_kana_i, XK_E, 0xff68, TRUE, 0 },
    { java_awt_event_KeyEvent_VK_OPEN_BRACKET, XK_kana_openingbracket, XK_braceleft, 0xff62, TRUE, 0 },
    { java_awt_event_KeyEvent_VK_CLOSE_BRACKET, XK_kana_closingbracket, XK_braceright, 0xff63, TRUE, 0 },
    { java_awt_event_KeyEvent_VK_Z, XK_kana_tsu, XK_Z, 0xff6f, TRUE, 0 },
    
    { java_awt_event_KeyEvent_VK_COMMA, XK_kana_comma, XK_comma, 0xff64, TRUE, 0 },
    { java_awt_event_KeyEvent_VK_PERIOD, XK_kana_fullstop, XK_greater, 0xff61, TRUE,0 },
    { java_awt_event_KeyEvent_VK_SLASH, XK_kana_conjunctive, XK_question, 0xff65, TRUE,0 },
    { 0, 0, 0 }
}

Definition at line 437 of file KeyMap.c.

long keyCode_XK_Delete = 0 [static]

Definition at line 841 of file KeyMap.c.

Definition at line 458 of file KeyMap.c.