Back to index

im-sdk  12.3.91
Defines | Typedefs | Functions
Converter.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "kolelog.h"
#include "Converter.h"

Go to the source code of this file.

Defines

#define False   0
#define True   1

Typedefs

typedef unsigned char * MString
typedef unsigned char * XPointer

Functions

static KeySym getX11KeySym (long awtKey)
 modifyEvent (long *keyCode, unsigned short *keyChar, long *State)

Define Documentation

#define False   0

Definition at line 10 of file Converter.c.

#define True   1

Definition at line 11 of file Converter.c.


Typedef Documentation

typedef unsigned char* MString

Definition at line 13 of file Converter.c.

typedef unsigned char* XPointer

Definition at line 14 of file Converter.c.


Function Documentation

static KeySym getX11KeySym ( long  awtKey) [static]

Definition at line 16 of file Converter.c.

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

Here is the caller graph for this function:

modifyEvent ( long *  keyCode,
unsigned short *  keyChar,
long *  State 
)

Definition at line 27 of file Converter.c.

{
    KeySym keysym = 0;
    long state = 0;
#ifndef NDEBUG
    KOLE_LOG (LOGDEST_STDOUT, "keycode:0x%x, keychar:0x%x, keystate:0x%x\n", *keyCode, *keyChar, *State);
#endif
    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_DELETE:
          keysym = getX11KeySym(*keyCode);
          break;
      default:
          if (*keyChar != 0 && *keyChar < 256) {
              keysym = *keyChar;
          } else {
              keysym = getX11KeySym(*keyCode);
          }
          break;
    }
    if (keysym >= 'A' && keysym <= 'Z') {
        state |= ShiftMask;
    }
    if (*State & java_awt_event_InputEvent_SHIFT_MASK) {
        state |= ShiftMask;
    }
    if (*State & java_awt_event_InputEvent_CTRL_MASK) {
        state |= ControlMask;
    }
    if (*State & java_awt_event_InputEvent_META_MASK) {
        state |= awt_MetaMask;
    }
    if (*State & java_awt_event_InputEvent_ALT_MASK) {
        state |= awt_AltMask;
    }

    *keyCode = keysym;
    if((*keyChar < 0x20) || (*keyChar > 0x7E))
       *keyChar = 0xFF;
    if(state != 0) *State = state;
#ifndef NDEBUG
    KOLE_LOG (LOGDEST_STDOUT, "keycode:0x%x, keychar:0x%x, keystate:0x%x\n", *keyCode, *keyChar, *State);
#endif
}

Here is the call graph for this function: