Back to index

im-sdk  12.3.91
Classes | Defines | Functions | Variables
keynames.c File Reference
#include <stdlib.h>
#include <string.h>
#include "keysyms.h"
#include "iiimcf.h"

Go to the source code of this file.

Classes

struct  x11_key

Defines

#define X11_NUM_KEYS   (sizeof (x11_keys_by_keyval) / sizeof (x11_keys_by_keyval[0]))

Functions

static int x11_keys_keyval_compare (const void *pkey, const void *pbase)
char * x11_keyval_name (unsigned int keyval)
static int x11_key_compare_by_name (const void *a, const void *b)
static int x11_keys_name_compare (const void *pkey, const void *pbase)
unsigned int x11_keyval_from_name (const char *keyval_name)
int g2icode (unsigned int kv)
unsigned int i2gcode (int kv)

Variables

static struct x11_key x11_keys_by_keyval []
static struct x11_keyx11_keys_by_name = NULL

Class Documentation

struct x11_key

Definition at line 8 of file keynames.c.

Class Members
unsigned int keyval
const char * name

Define Documentation

#define X11_NUM_KEYS   (sizeof (x11_keys_by_keyval) / sizeof (x11_keys_by_keyval[0]))

Definition at line 1318 of file keynames.c.


Function Documentation

int g2icode ( unsigned int  kv)

Definition at line 1402 of file keynames.c.

{
  switch (kv)
    {
    case X11_VoidSymbol:
      return 0;
    case X11_BackSpace:
      return IIIMF_KEYCODE_BACK_SPACE;
    case X11_Tab:
      return IIIMF_KEYCODE_TAB;
    case X11_Linefeed:
      return IIIMF_KEYCODE_ENTER;
    case X11_Clear:
      return -IIIMF_KEYCODE_CLEAR;
    case X11_Return:
      return IIIMF_KEYCODE_ENTER;
    case X11_Pause:
      return IIIMF_KEYCODE_PAUSE;
    case X11_Scroll_Lock:
      return -IIIMF_KEYCODE_SCROLL_LOCK;
    case X11_Sys_Req:
      return 0;
    case X11_Escape:
      return IIIMF_KEYCODE_ESCAPE;
    case X11_Delete:
      return IIIMF_KEYCODE_DELETE;
    case X11_Multi_key:
      return IIIMF_KEYCODE_COMPOSE;
    case X11_Codeinput:
      return -IIIMF_KEYCODE_CODE_INPUT;
    case X11_SingleCandidate:
    case X11_MultipleCandidate:
      return 0;
    case X11_PreviousCandidate:
      return -IIIMF_KEYCODE_PREVIOUS_CANDIDATE;
    case X11_Kanji:
      return -IIIMF_KEYCODE_KANJI;
    case X11_Muhenkan:
      return -IIIMF_KEYCODE_NONCONVERT;
    case X11_Henkan_Mode:
      /* case X11_Henkan: */
      return -IIIMF_KEYCODE_CONVERT;
    case X11_Romaji:
      return -IIIMF_KEYCODE_ROMAN_CHARACTERS;
    case X11_Hiragana:
      return -IIIMF_KEYCODE_HIRAGANA;
    case X11_Katakana:
      return -IIIMF_KEYCODE_KATAKANA;
    case X11_Hiragana_Katakana:
      return 0;
    case X11_Zenkaku:
      return -IIIMF_KEYCODE_FULL_WIDTH;
    case X11_Hankaku:
      return -IIIMF_KEYCODE_HALF_WIDTH;
    case X11_Kana_Lock:
      return -IIIMF_KEYCODE_KANA_LOCK;
    case X11_Home:
      return -IIIMF_KEYCODE_HOME;
    case X11_Left:
      return -IIIMF_KEYCODE_LEFT;
    case X11_Up:
      return -IIIMF_KEYCODE_UP;
    case X11_Right:
      return -IIIMF_KEYCODE_RIGHT;
    case X11_Down:
      return -IIIMF_KEYCODE_DOWN;
    case X11_Page_Up:
      return -IIIMF_KEYCODE_PAGE_UP;
    case X11_Page_Down:
      return -IIIMF_KEYCODE_PAGE_DOWN;
    case X11_End:
      return -IIIMF_KEYCODE_END;
    case X11_Print:
      return -IIIMF_KEYCODE_PRINTSCREEN;
    case X11_Insert:
      return IIIMF_KEYCODE_INSERT;
    case X11_Undo:
      return -IIIMF_KEYCODE_UNDO;
    case X11_Find:
      return -IIIMF_KEYCODE_FIND;
    case X11_Cancel:
      return -IIIMF_KEYCODE_CANCEL;
    case X11_Help:
      return -IIIMF_KEYCODE_HELP;
    case X11_Mode_switch:
      /* case X11_script_switch: */
      return -IIIMF_KEYCODE_MODECHANGE;
    case X11_Num_Lock:
      return -IIIMF_KEYCODE_NUM_LOCK;
    case X11_KP_Space:
      return IIIMF_KEYCODE_SPACE;
    case X11_KP_Tab:
      return IIIMF_KEYCODE_TAB;
    case X11_KP_Enter:
      return IIIMF_KEYCODE_ENTER;
    case X11_KP_F1:
      return -IIIMF_KEYCODE_F1;
    case X11_KP_F2:
      return -IIIMF_KEYCODE_F2;
    case X11_KP_F3:
      return -IIIMF_KEYCODE_F3;
    case X11_KP_F4:
      return -IIIMF_KEYCODE_F4;
    case X11_KP_Home:
      return -IIIMF_KEYCODE_HOME;
    case X11_KP_Left:
      return -IIIMF_KEYCODE_LEFT;
    case X11_KP_Up:
      return -IIIMF_KEYCODE_UP;
    case X11_KP_Right:
      return -IIIMF_KEYCODE_RIGHT;
    case X11_KP_Down:
      return -IIIMF_KEYCODE_DOWN;
    case X11_KP_Page_Up:
      return -IIIMF_KEYCODE_PAGE_UP;
    case X11_KP_Page_Down:
      return -IIIMF_KEYCODE_PAGE_DOWN;
    case X11_KP_End:
      return -IIIMF_KEYCODE_END;
    case X11_KP_Insert:
      return IIIMF_KEYCODE_INSERT;
    case X11_KP_Delete:
      return IIIMF_KEYCODE_DELETE;
    case X11_KP_Equal:
      return IIIMF_KEYCODE_EQUALS;
    case X11_KP_Multiply:
      return IIIMF_KEYCODE_MULTIPLY;
    case X11_KP_Add:
      return IIIMF_KEYCODE_ADD;
    case X11_KP_Separator:
      return IIIMF_KEYCODE_SEPARATOR;
    case X11_KP_Subtract:
      return IIIMF_KEYCODE_SUBTRACT;
    case X11_KP_Decimal:
      return IIIMF_KEYCODE_DECIMAL;
    case X11_KP_Divide:
      return IIIMF_KEYCODE_DIVIDE;
    case X11_KP_0:
      return IIIMF_KEYCODE_NUMPAD0;
    case X11_KP_1:
      return IIIMF_KEYCODE_NUMPAD1;
    case X11_KP_2:
      return IIIMF_KEYCODE_NUMPAD2;
    case X11_KP_3:
      return IIIMF_KEYCODE_NUMPAD3;
    case X11_KP_4:
      return IIIMF_KEYCODE_NUMPAD4;
    case X11_KP_5:
      return IIIMF_KEYCODE_NUMPAD5;
    case X11_KP_6:
      return IIIMF_KEYCODE_NUMPAD6;
    case X11_KP_7:
      return IIIMF_KEYCODE_NUMPAD7;
    case X11_KP_8:
      return IIIMF_KEYCODE_NUMPAD8;
    case X11_KP_9:
      return IIIMF_KEYCODE_NUMPAD9;
    case X11_F1:
      return -IIIMF_KEYCODE_F1;
    case X11_F2:
      return -IIIMF_KEYCODE_F2;
    case X11_F3:
      return -IIIMF_KEYCODE_F3;
    case X11_F4:
      return -IIIMF_KEYCODE_F4;
    case X11_F5:
      return -IIIMF_KEYCODE_F5;
    case X11_F6:
      return -IIIMF_KEYCODE_F6;
    case X11_F7:
      return -IIIMF_KEYCODE_F7;
    case X11_F8:
      return -IIIMF_KEYCODE_F8;
    case X11_F9:
      return -IIIMF_KEYCODE_F9;
    case X11_F10:
      return -IIIMF_KEYCODE_F10;
    case X11_F11:
      /*case X11_L1: */
      return -IIIMF_KEYCODE_F11;
    case X11_F12:
      /* case X11_L2: */
      return -IIIMF_KEYCODE_F12;
    case X11_F13:
      /* case X11_L3: */
      return -IIIMF_KEYCODE_F13;
    case X11_F14:
      /* case X11_L4: */
      return -IIIMF_KEYCODE_F14;
    case X11_F15:
      /* case X11_L5: */
      return -IIIMF_KEYCODE_F15;
    case X11_F16:
      /* case X11_L6: */
      return -IIIMF_KEYCODE_F16;
    case X11_F17:
      /* case X11_L7: */
      return -IIIMF_KEYCODE_F17;
    case X11_F18:
      /* case X11_L8: */
      return -IIIMF_KEYCODE_F18;
    case X11_F19:
      /* case X11_L9: */
      return -IIIMF_KEYCODE_F19;
    case X11_F20:
      /* case X11_L10: */
      return -IIIMF_KEYCODE_F20;
    case X11_F21:
      /* case X11_R1: */
      return -IIIMF_KEYCODE_F21;
    case X11_F22:
      /* case X11_R2: */
      return -IIIMF_KEYCODE_F22;
    case X11_F23:
      /* case X11_R3: */
      return -IIIMF_KEYCODE_F23;
    case X11_F24:
      /* case X11_R4: */
      return -IIIMF_KEYCODE_F24;
    case X11_Shift_L:
    case X11_Shift_R:
      return -IIIMF_KEYCODE_SHIFT;
    case X11_Control_L:
    case X11_Control_R:
      return -IIIMF_KEYCODE_CONTROL;
    case X11_Caps_Lock:
      return -IIIMF_KEYCODE_CAPS_LOCK;
    case X11_Meta_L:
    case X11_Meta_R:
      return -IIIMF_KEYCODE_META;
    case X11_Alt_L:
    case X11_Alt_R:
      return -IIIMF_KEYCODE_ALT;
    case X11_dead_grave:
      return IIIMF_KEYCODE_DEAD_GRAVE;
    case X11_dead_acute:
      return IIIMF_KEYCODE_DEAD_ACUTE;
    case X11_dead_circumflex:
      return IIIMF_KEYCODE_DEAD_CIRCUMFLEX;
    case X11_dead_tilde:
      return IIIMF_KEYCODE_DEAD_TILDE;
    case X11_dead_macron:
      return IIIMF_KEYCODE_DEAD_MACRON;
    case X11_dead_breve:
      return IIIMF_KEYCODE_DEAD_BREVE;
    case X11_dead_abovedot:
      return IIIMF_KEYCODE_DEAD_ABOVEDOT;
    case X11_dead_diaeresis:
      return IIIMF_KEYCODE_DEAD_DIAERESIS;
    case X11_dead_abovering:
      return IIIMF_KEYCODE_DEAD_ABOVERING;
    case X11_dead_doubleacute:
      return IIIMF_KEYCODE_DEAD_DOUBLEACUTE;
    case X11_dead_caron:
      return IIIMF_KEYCODE_DEAD_CARON;
    case X11_dead_cedilla:
      return IIIMF_KEYCODE_DEAD_CEDILLA;
    case X11_dead_ogonek:
      return IIIMF_KEYCODE_DEAD_OGONEK;
    case X11_dead_iota:
      return IIIMF_KEYCODE_DEAD_IOTA;
    case X11_dead_voiced_sound:
      return IIIMF_KEYCODE_DEAD_VOICED_SOUND;
    case X11_dead_semivoiced_sound:
      return IIIMF_KEYCODE_DEAD_SEMIVOICED_SOUND;

    case X11_space:
      return IIIMF_KEYCODE_SPACE;
    case X11_exclam:
      return IIIMF_KEYCODE_EXCLAMATION_MARK;
    case X11_quotedbl:
      return IIIMF_KEYCODE_QUOTEDBL;
    case X11_numbersign:
      return IIIMF_KEYCODE_NUMBER_SIGN;
    case X11_dollar:
      return IIIMF_KEYCODE_DOLLAR;
    case X11_ampersand:
      return IIIMF_KEYCODE_AMPERSAND;
    case X11_apostrophe:
      /* case X11_quoteright: */
      return IIIMF_KEYCODE_QUOTE;
    case X11_parenleft:
      return IIIMF_KEYCODE_LEFT_PARENTHESIS;
    case X11_parenright:
      return IIIMF_KEYCODE_RIGHT_PARENTHESIS;
    case X11_asterisk:
      return IIIMF_KEYCODE_ASTERISK;
    case X11_plus:
      return IIIMF_KEYCODE_PLUS;
    case X11_comma:
      return IIIMF_KEYCODE_COMMA;
    case X11_minus:
      return IIIMF_KEYCODE_MINUS;
    case X11_period:
      return IIIMF_KEYCODE_PERIOD;
    case X11_slash:
      return IIIMF_KEYCODE_SLASH;
    case X11_0:
      return IIIMF_KEYCODE_0;
    case X11_1:
      return IIIMF_KEYCODE_1;
    case X11_2:
      return IIIMF_KEYCODE_2;
    case X11_3:
      return IIIMF_KEYCODE_3;
    case X11_4:
      return IIIMF_KEYCODE_4;
    case X11_5:
      return IIIMF_KEYCODE_5;
    case X11_6:
      return IIIMF_KEYCODE_6;
    case X11_7:
      return IIIMF_KEYCODE_7;
    case X11_8:
      return IIIMF_KEYCODE_8;
    case X11_9:
      return IIIMF_KEYCODE_9;
    case X11_colon:
      return IIIMF_KEYCODE_COLON;
    case X11_semicolon:
      return IIIMF_KEYCODE_SEMICOLON;
    case X11_less:
      return IIIMF_KEYCODE_LESS;
    case X11_equal:
      return IIIMF_KEYCODE_EQUALS;
    case X11_greater:
      return IIIMF_KEYCODE_GREATER;
    case X11_at:
      return IIIMF_KEYCODE_AT;
    case X11_A:
      return IIIMF_KEYCODE_A;
    case X11_B:
      return IIIMF_KEYCODE_B;
    case X11_C:
      return IIIMF_KEYCODE_C;
    case X11_D:
      return IIIMF_KEYCODE_D;
    case X11_E:
      return IIIMF_KEYCODE_E;
    case X11_F:
      return IIIMF_KEYCODE_F;
    case X11_G:
      return IIIMF_KEYCODE_G;
    case X11_H:
      return IIIMF_KEYCODE_H;
    case X11_I:
      return IIIMF_KEYCODE_I;
    case X11_J:
      return IIIMF_KEYCODE_J;
    case X11_K:
      return IIIMF_KEYCODE_K;
    case X11_L:
      return IIIMF_KEYCODE_L;
    case X11_M:
      return IIIMF_KEYCODE_M;
    case X11_N:
      return IIIMF_KEYCODE_N;
    case X11_O:
      return IIIMF_KEYCODE_O;
    case X11_P:
      return IIIMF_KEYCODE_P;
    case X11_Q:
      return IIIMF_KEYCODE_Q;
    case X11_R:
      return IIIMF_KEYCODE_R;
    case X11_S:
      return IIIMF_KEYCODE_S;
    case X11_T:
      return IIIMF_KEYCODE_T;
    case X11_U:
      return IIIMF_KEYCODE_U;
    case X11_V:
      return IIIMF_KEYCODE_V;
    case X11_W:
      return IIIMF_KEYCODE_W;
    case X11_X:
      return IIIMF_KEYCODE_X;
    case X11_Y:
      return IIIMF_KEYCODE_Y;
    case X11_Z:
      return IIIMF_KEYCODE_Z;

    case X11_bracketleft:
      return IIIMF_KEYCODE_OPEN_BRACKET;
    case X11_backslash:
      return IIIMF_KEYCODE_BACK_SLASH;
    case X11_bracketright:
      return IIIMF_KEYCODE_CLOSE_BRACKET;
    case X11_asciicircum:
      return IIIMF_KEYCODE_CIRCUMFLEX;
    case X11_underscore:
      return IIIMF_KEYCODE_UNDERSCORE;
    case X11_grave:
      /* case X11_quoteleft: */
      return IIIMF_KEYCODE_BACK_QUOTE;

    case X11_a:
      return IIIMF_KEYCODE_A;
    case X11_b:
      return IIIMF_KEYCODE_B;
    case X11_c:
      return IIIMF_KEYCODE_C;
    case X11_d:
      return IIIMF_KEYCODE_D;
    case X11_e:
      return IIIMF_KEYCODE_E;
    case X11_f:
      return IIIMF_KEYCODE_F;
    case X11_g:
      return IIIMF_KEYCODE_G;
    case X11_h:
      return IIIMF_KEYCODE_H;
    case X11_i:
      return IIIMF_KEYCODE_I;
    case X11_j:
      return IIIMF_KEYCODE_J;
    case X11_k:
      return IIIMF_KEYCODE_K;
    case X11_l:
      return IIIMF_KEYCODE_L;
    case X11_m:
      return IIIMF_KEYCODE_M;
    case X11_n:
      return IIIMF_KEYCODE_N;
    case X11_o:
      return IIIMF_KEYCODE_O;
    case X11_p:
      return IIIMF_KEYCODE_P;
    case X11_q:
      return IIIMF_KEYCODE_Q;
    case X11_r:
      return IIIMF_KEYCODE_R;
    case X11_s:
      return IIIMF_KEYCODE_S;
    case X11_t:
      return IIIMF_KEYCODE_T;
    case X11_u:
      return IIIMF_KEYCODE_U;
    case X11_v:
      return IIIMF_KEYCODE_V;
    case X11_w:
      return IIIMF_KEYCODE_W;
    case X11_x:
      return IIIMF_KEYCODE_X;
    case X11_y:
      return IIIMF_KEYCODE_Y;
    case X11_z:
      return IIIMF_KEYCODE_Z;
    case X11_braceleft:
      return IIIMF_KEYCODE_BRACELEFT;
    case X11_braceright:
      return IIIMF_KEYCODE_BRACERIGHT;

    case X11_exclamdown:
      return IIIMF_KEYCODE_INVERTED_EXCLAMATION_MARK;

    case X11_EuroSign:
      return IIIMF_KEYCODE_EURO_SIGN;

    case X11_Zenkaku_Hankaku:
      return IIIMF_KEYCODE_KANJI;

    default:
      return 0;
    }

  return 0;
}
unsigned int i2gcode ( int  kv)

Definition at line 1872 of file keynames.c.

{
  switch (kv)
    {
      /* case IIIMF_KEYCODE_UNDEFINED */
    case IIIMF_KEYCODE_CANCEL:
      return X11_Cancel;
    case IIIMF_KEYCODE_BACK_SPACE:
      return X11_BackSpace;
    case IIIMF_KEYCODE_TAB:
      return X11_Tab;
    case IIIMF_KEYCODE_ENTER:
      return X11_Return;
    case IIIMF_KEYCODE_CLEAR:
      return X11_Clear;
    case IIIMF_KEYCODE_SHIFT:
      return X11_Shift_L;   /* ... */
    case IIIMF_KEYCODE_CONTROL:
      return X11_Control_L; /* ... */
    case IIIMF_KEYCODE_ALT:
      return X11_Alt_L;
    case IIIMF_KEYCODE_PAUSE:
      return X11_Pause;
    case IIIMF_KEYCODE_CAPS_LOCK:
      return X11_Caps_Lock;
      /*
         case IIIMF_KEYCODE_KANA
         case IIIMF_KEYCODE_FINAL
       */
    case IIIMF_KEYCODE_KANJI:
      return X11_Kanji;

    case IIIMF_KEYCODE_ESCAPE:
      return X11_Escape;
    case IIIMF_KEYCODE_CONVERT:
      return X11_Henkan_Mode;
    case IIIMF_KEYCODE_NONCONVERT:
      return X11_Muhenkan;
      /* case IIIMF_KEYCODE_ACCEPT */
    case IIIMF_KEYCODE_MODECHANGE:
      return X11_Mode_switch;
    case IIIMF_KEYCODE_SPACE:
      return X11_space;
    case IIIMF_KEYCODE_PAGE_UP:
      return X11_Page_Up;
    case IIIMF_KEYCODE_PAGE_DOWN:
      return X11_Page_Down;
    case IIIMF_KEYCODE_END:
      return X11_End;
    case IIIMF_KEYCODE_HOME:
      return X11_Home;
    case IIIMF_KEYCODE_LEFT:
      return X11_Left;
    case IIIMF_KEYCODE_UP:
      return X11_Up;
    case IIIMF_KEYCODE_RIGHT:
      return X11_Right;
    case IIIMF_KEYCODE_DOWN:
      return X11_Down;
    case IIIMF_KEYCODE_COMMA:
      return X11_comma;
    case IIIMF_KEYCODE_MINUS:
      return X11_minus;
    case IIIMF_KEYCODE_PERIOD:
      return X11_period;
    case IIIMF_KEYCODE_SLASH:
      return X11_slash;
    case IIIMF_KEYCODE_0:
      return X11_0;
    case IIIMF_KEYCODE_1:
      return X11_1;
    case IIIMF_KEYCODE_2:
      return X11_2;
    case IIIMF_KEYCODE_3:
      return X11_3;
    case IIIMF_KEYCODE_4:
      return X11_4;
    case IIIMF_KEYCODE_5:
      return X11_5;
    case IIIMF_KEYCODE_6:
      return X11_6;
    case IIIMF_KEYCODE_7:
      return X11_7;
    case IIIMF_KEYCODE_8:
      return X11_8;
    case IIIMF_KEYCODE_9:
      return X11_9;
    case IIIMF_KEYCODE_SEMICOLON:
      return X11_semicolon;
    case IIIMF_KEYCODE_EQUALS:
      return X11_equal;
    case IIIMF_KEYCODE_A:
      return X11_a;
    case IIIMF_KEYCODE_B:
      return X11_b;
    case IIIMF_KEYCODE_C:
      return X11_c;
    case IIIMF_KEYCODE_D:
      return X11_d;
    case IIIMF_KEYCODE_E:
      return X11_e;
    case IIIMF_KEYCODE_F:
      return X11_f;
    case IIIMF_KEYCODE_G:
      return X11_g;
    case IIIMF_KEYCODE_H:
      return X11_h;
    case IIIMF_KEYCODE_I:
      return X11_i;
    case IIIMF_KEYCODE_J:
      return X11_j;
    case IIIMF_KEYCODE_K:
      return X11_k;
    case IIIMF_KEYCODE_L:
      return X11_l;
    case IIIMF_KEYCODE_M:
      return X11_m;
    case IIIMF_KEYCODE_N:
      return X11_n;
    case IIIMF_KEYCODE_O:
      return X11_o;
    case IIIMF_KEYCODE_P:
      return X11_p;
    case IIIMF_KEYCODE_Q:
      return X11_q;
    case IIIMF_KEYCODE_R:
      return X11_r;
    case IIIMF_KEYCODE_S:
      return X11_s;
    case IIIMF_KEYCODE_T:
      return X11_t;
    case IIIMF_KEYCODE_U:
      return X11_u;
    case IIIMF_KEYCODE_V:
      return X11_v;
    case IIIMF_KEYCODE_W:
      return X11_w;
    case IIIMF_KEYCODE_X:
      return X11_x;
    case IIIMF_KEYCODE_Y:
      return X11_y;
    case IIIMF_KEYCODE_Z:
      return X11_z;
    case IIIMF_KEYCODE_OPEN_BRACKET:
      return X11_bracketleft;
    case IIIMF_KEYCODE_BACK_SLASH:
      return X11_backslash;
    case IIIMF_KEYCODE_CLOSE_BRACKET:
      return X11_bracketright;
    case IIIMF_KEYCODE_NUMPAD0:
      return X11_KP_0;
    case IIIMF_KEYCODE_NUMPAD1:
      return X11_KP_1;
    case IIIMF_KEYCODE_NUMPAD2:
      return X11_KP_2;
    case IIIMF_KEYCODE_NUMPAD3:
      return X11_KP_3;
    case IIIMF_KEYCODE_NUMPAD4:
      return X11_KP_4;
    case IIIMF_KEYCODE_NUMPAD5:
      return X11_KP_5;
    case IIIMF_KEYCODE_NUMPAD6:
      return X11_KP_6;
    case IIIMF_KEYCODE_NUMPAD7:
      return X11_KP_7;
    case IIIMF_KEYCODE_NUMPAD8:
      return X11_KP_8;
    case IIIMF_KEYCODE_NUMPAD9:
      return X11_KP_9;
    case IIIMF_KEYCODE_MULTIPLY:
      return X11_KP_Multiply;
    case IIIMF_KEYCODE_ADD:
      return X11_KP_Add;
    case IIIMF_KEYCODE_SEPARATOR:
      return X11_KP_Separator;
    case IIIMF_KEYCODE_SUBTRACT:
      return X11_KP_Subtract;
    case IIIMF_KEYCODE_DECIMAL:
      return X11_KP_Decimal;
    case IIIMF_KEYCODE_DIVIDE:
      return X11_KP_Divide;
    case IIIMF_KEYCODE_F1:
      return X11_F1;
    case IIIMF_KEYCODE_F2:
      return X11_F2;
    case IIIMF_KEYCODE_F3:
      return X11_F3;
    case IIIMF_KEYCODE_F4:
      return X11_F4;
    case IIIMF_KEYCODE_F5:
      return X11_F5;
    case IIIMF_KEYCODE_F6:
      return X11_F6;
    case IIIMF_KEYCODE_F7:
      return X11_F7;
    case IIIMF_KEYCODE_F8:
      return X11_F8;
    case IIIMF_KEYCODE_F9:
      return X11_F9;
    case IIIMF_KEYCODE_F10:
      return X11_F10;
    case IIIMF_KEYCODE_F11:
      return X11_F11;
    case IIIMF_KEYCODE_F12:
      return X11_F12;
    case IIIMF_KEYCODE_DELETE:
      return X11_Delete;
    case IIIMF_KEYCODE_DEAD_GRAVE:
      return X11_dead_grave;
    case IIIMF_KEYCODE_DEAD_ACUTE:
      return X11_dead_acute;
    case IIIMF_KEYCODE_DEAD_CIRCUMFLEX:
      return X11_dead_circumflex;
    case IIIMF_KEYCODE_DEAD_TILDE:
      return X11_dead_tilde;
    case IIIMF_KEYCODE_DEAD_MACRON:
      return X11_dead_macron;
    case IIIMF_KEYCODE_DEAD_BREVE:
      return X11_dead_breve;
    case IIIMF_KEYCODE_DEAD_ABOVEDOT:
      return X11_dead_abovedot;
    case IIIMF_KEYCODE_DEAD_DIAERESIS:
      return X11_dead_diaeresis;
    case IIIMF_KEYCODE_DEAD_ABOVERING:
      return X11_dead_abovering;
    case IIIMF_KEYCODE_DEAD_DOUBLEACUTE:
      return X11_dead_doubleacute;
    case IIIMF_KEYCODE_DEAD_CARON:
      return X11_dead_caron;
    case IIIMF_KEYCODE_DEAD_CEDILLA:
      return X11_dead_cedilla;
    case IIIMF_KEYCODE_DEAD_OGONEK:
      return X11_dead_ogonek;
    case IIIMF_KEYCODE_DEAD_IOTA:
      return X11_dead_iota;
    case IIIMF_KEYCODE_DEAD_VOICED_SOUND:
      return X11_dead_voiced_sound;
    case IIIMF_KEYCODE_DEAD_SEMIVOICED_SOUND:
      return X11_dead_semivoiced_sound;
    case IIIMF_KEYCODE_NUM_LOCK:
      return X11_Num_Lock;
    case IIIMF_KEYCODE_SCROLL_LOCK:
      return X11_Scroll_Lock;
    case IIIMF_KEYCODE_AMPERSAND:
      return X11_ampersand;
    case IIIMF_KEYCODE_ASTERISK:
      return X11_asterisk;
    case IIIMF_KEYCODE_QUOTEDBL:
      return X11_quotedbl;
    case IIIMF_KEYCODE_LESS:
      return X11_less;
    case IIIMF_KEYCODE_PRINTSCREEN:
      return X11_Print;
    case IIIMF_KEYCODE_INSERT:
      return X11_Insert;
    case IIIMF_KEYCODE_HELP:
      return X11_Help;
    case IIIMF_KEYCODE_META:
      return X11_Meta_L;
    case IIIMF_KEYCODE_GREATER:
      return X11_greater;
    case IIIMF_KEYCODE_BRACELEFT:
      return X11_braceleft;
    case IIIMF_KEYCODE_BRACERIGHT:
      return X11_braceright;
    case IIIMF_KEYCODE_BACK_QUOTE:
      return X11_grave;
    case IIIMF_KEYCODE_QUOTE:
      return X11_apostrophe;
    case IIIMF_KEYCODE_KP_UP:
      return X11_KP_Up;
    case IIIMF_KEYCODE_KP_DOWN:
      return X11_KP_Down;
    case IIIMF_KEYCODE_KP_LEFT:
      return X11_KP_Left;
    case IIIMF_KEYCODE_KP_RIGHT:
      return X11_KP_Right;
      /* case IIIMF_KEYCODE_ALPHANUMERIC */
    case IIIMF_KEYCODE_KATAKANA:
      return X11_Katakana;
    case IIIMF_KEYCODE_HIRAGANA:
      return X11_Hiragana;
    case IIIMF_KEYCODE_FULL_WIDTH:
      return X11_Zenkaku;
    case IIIMF_KEYCODE_HALF_WIDTH:
      return X11_Hankaku;
    case IIIMF_KEYCODE_ROMAN_CHARACTERS:
      return X11_Romaji;
      /* case IIIMF_KEYCODE_ALL_CANDIDATES */
    case IIIMF_KEYCODE_PREVIOUS_CANDIDATE:
      return X11_PreviousCandidate;
    case IIIMF_KEYCODE_CODE_INPUT:
      return X11_Codeinput;
    case IIIMF_KEYCODE_JAPANESE_KATAKANA:
      return X11_Katakana;
    case IIIMF_KEYCODE_JAPANESE_HIRAGANA:
      return X11_Hiragana;
/*     case IIIMF_KEYCODE_JAPANESE_ROMAN */
    case IIIMF_KEYCODE_KANA_LOCK:
      return X11_Kana_Lock;
      /* case IIIMF_KEYCODE_INPUT_METHOD_ON_OFF */
    case IIIMF_KEYCODE_AT:
      return X11_at;
    case IIIMF_KEYCODE_COLON:
      return X11_colon;
    case IIIMF_KEYCODE_CIRCUMFLEX:
      return X11_asciicircum;
    case IIIMF_KEYCODE_DOLLAR:
      return X11_dollar;
    case IIIMF_KEYCODE_EURO_SIGN:
      return X11_EuroSign;
    case IIIMF_KEYCODE_EXCLAMATION_MARK:
      return X11_exclam;
    case IIIMF_KEYCODE_INVERTED_EXCLAMATION_MARK:
      return X11_exclamdown;
    case IIIMF_KEYCODE_LEFT_PARENTHESIS:
      return X11_parenleft;
    case IIIMF_KEYCODE_NUMBER_SIGN:
      return X11_numbersign;
    case IIIMF_KEYCODE_PLUS:
      return X11_plus;
    case IIIMF_KEYCODE_RIGHT_PARENTHESIS:
      return X11_parenright;
    case IIIMF_KEYCODE_UNDERSCORE:
      return X11_underscore;
    case IIIMF_KEYCODE_F13:
      return X11_F13;
    case IIIMF_KEYCODE_F14:
      return X11_F14;
    case IIIMF_KEYCODE_F15:
      return X11_F15;
    case IIIMF_KEYCODE_F16:
      return X11_F16;
    case IIIMF_KEYCODE_F17:
      return X11_F17;
    case IIIMF_KEYCODE_F18:
      return X11_F18;
    case IIIMF_KEYCODE_F19:
      return X11_F19;
    case IIIMF_KEYCODE_F20:
      return X11_F20;
    case IIIMF_KEYCODE_F21:
      return X11_F21;
    case IIIMF_KEYCODE_F22:
      return X11_F22;
    case IIIMF_KEYCODE_F23:
      return X11_F23;
    case IIIMF_KEYCODE_F24:
      return X11_F24;
      /*
         case IIIMF_KEYCODE_COMPOSE:
         case IIIMF_KEYCODE_ALT_GRAPH
         case IIIMF_KEYCODE_STOP
         case IIIMF_KEYCODE_AGAIN
         case IIIMF_KEYCODE_PROPS
       */
    case IIIMF_KEYCODE_UNDO:
      return X11_Undo;
      /*
         case IIIMF_KEYCODE_COPY
         case IIIMF_KEYCODE_PASTE
       */
    case IIIMF_KEYCODE_FIND:
      return X11_Find;
      /* case IIIMF_KEYCODE_CUT */

    default:
      return (unsigned int) (kv & 0x7fffffff);
    }
  return 0;
}
static int x11_key_compare_by_name ( const void *  a,
const void *  b 
) [static]

Definition at line 1363 of file keynames.c.

{
  return strcmp (((const struct x11_key *) a)->name, ((const struct x11_key *) b)->name);
}

Here is the caller graph for this function:

static int x11_keys_keyval_compare ( const void *  pkey,
const void *  pbase 
) [static]

Definition at line 1323 of file keynames.c.

{
  return (*(int *) pkey) - ((struct x11_key *) pbase)->keyval;
}

Here is the caller graph for this function:

static int x11_keys_name_compare ( const void *  pkey,
const void *  pbase 
) [static]

Definition at line 1369 of file keynames.c.

{
  return strcmp ((const char *) pkey, ((const struct x11_key *) pbase)->name);
}

Here is the caller graph for this function:

unsigned int x11_keyval_from_name ( const char *  keyval_name)

Definition at line 1375 of file keynames.c.

{
  struct x11_key *found;

  if (keyval_name == NULL) return 0;
  
  if (x11_keys_by_name == NULL)
    {
      x11_keys_by_name = malloc (sizeof (struct x11_key) * X11_NUM_KEYS);

      memcpy (x11_keys_by_name, x11_keys_by_keyval,
             X11_NUM_KEYS * sizeof (struct x11_key));

      qsort (x11_keys_by_name, X11_NUM_KEYS, sizeof (struct x11_key),
            x11_key_compare_by_name);
    }

  found = bsearch (keyval_name, x11_keys_by_name,
                 X11_NUM_KEYS, sizeof (struct x11_key),
                 x11_keys_name_compare);
  if (found != NULL)
    return found->keyval;
  else
    return 0xFFFF;
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* x11_keyval_name ( unsigned int  keyval)

Definition at line 1329 of file keynames.c.

{
  static char buf[100];
  struct x11_key *found;

  /* Check for directly encoded 24-bit UCS characters: */
  if ((keyval & 0xff000000) == 0x01000000)
    {
      sprintf (buf, "U+%.04X", (keyval & 0x00ffffff));
      return buf;
    }

  found = bsearch (&keyval, x11_keys_by_keyval,
                 X11_NUM_KEYS, sizeof (struct x11_key),
                 x11_keys_keyval_compare);

  if (found != NULL)
    {
      while ((found > x11_keys_by_keyval) &&
             ((found - 1)->keyval == keyval))
        found--;
           
      return (char *) found->name;
    }
  else if (keyval != 0)
    {
      sprintf (buf, "%#x", keyval);
      return buf;
    }

  return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

struct x11_key x11_keys_by_keyval[] [static]
struct x11_key* x11_keys_by_name = NULL [static]

Definition at line 1320 of file keynames.c.