home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / AP / JED / JED097-1.TAR / jed / src / xkeys.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  24.0 KB  |  788 lines

  1. /* xkeys.c */
  2. /* The first character is the length of the string */
  3. #define MAX_KEYSYM_STRING_LEN 8
  4.  
  5. typedef char KeySym_Mapping_Type[MAX_KEYSYM_STRING_LEN + 1];
  6.  
  7. static KeySym_Mapping_Type KeySym_Mapping[256] =
  8. {
  9.    "\004\033[3~",    /* 0xFF00                        Remove */
  10.    "",            /* 0xFF01 */
  11.    "",            /* 0xFF02 */
  12.    "",            /* 0xFF03 */
  13.    "",            /* 0xFF04 */
  14.    "",            /* 0xFF05 */
  15.    "",            /* 0xFF06 */
  16.    "",            /* 0xFF07 */
  17.    "\001\177",        /* 0xFF08      XK_BackSpace */
  18.    "\001\t",        /* 0xFF09      XK_Tab */
  19.    "\001\n",        /* 0xFF0A      XK_Linefeed */
  20.    "",            /* 0xFF0B      XK_Clear */
  21.    "",            /* 0xFF0C */
  22.    "\001\r",        /* 0xFF0D      XK_Return */
  23.    "",            /* 0xFF0E */
  24.    "",            /* 0xFF0F */
  25.    "",            /* 0xFF10 */
  26.    "",            /* 0xFF11 */
  27.    "",            /* 0xFF12 */
  28.    "",            /* 0xFF13      XK_Pause */
  29.    "",            /* 0xFF14      XK_Scroll_Lock */
  30.    "",            /* 0xFF15 */
  31.    "",            /* 0xFF16 */
  32.    "",            /* 0xFF17 */
  33.    "",            /* 0xFF18 */
  34.    "",            /* 0xFF19 */
  35.    "",            /* 0xFF1A */
  36.    "\001\033",        /* 0xFF1B      XK_Escape */
  37.    "",            /* 0xFF1C */
  38.    "",            /* 0xFF1D */
  39.    "",            /* 0xFF1E */
  40.    "",            /* 0xFF1F */
  41.    "",            /* 0xFF20      XK_Multi_key */
  42.    "",            /* 0xFF21      XK_Kanji */
  43.    "",            /* 0xFF22      XK_Muhenkan */
  44.    "",            /* 0xFF23      XK_Henkan_Mode      XK_Henkan */
  45.    "",            /* 0xFF24      XK_Romaji */
  46.    "",            /* 0xFF25      XK_Hiragana */
  47.    "",            /* 0xFF26      XK_Katakana */
  48.    "",            /* 0xFF27      XK_Hiragana_Katakana */
  49.    "",            /* 0xFF28      XK_Zenkaku */
  50.    "",            /* 0xFF29      XK_Hankaku */
  51.    "",            /* 0xFF2A      XK_Zenkaku_Hankaku */
  52.    "",            /* 0xFF2B      XK_Touroku */
  53.    "",            /* 0xFF2C      XK_Massyo */
  54.    "",            /* 0xFF2D      XK_Kana_Lock */
  55.    "",            /* 0xFF2E      XK_Kana_Shift */
  56.    "",            /* 0xFF2F      XK_Eisu_Shift */
  57.    "",            /* 0xFF30      XK_Eisu_toggle */
  58.    "",            /* 0xFF31 */
  59.    "",            /* 0xFF32 */
  60.    "",            /* 0xFF33 */
  61.    "",            /* 0xFF34 */
  62.    "",            /* 0xFF35 */
  63.    "",            /* 0xFF36 */
  64.    "",            /* 0xFF37 */
  65.    "",            /* 0xFF38 */
  66.    "",            /* 0xFF39 */
  67.    "",            /* 0xFF3A */
  68.    "",            /* 0xFF3B */
  69.    "",            /* 0xFF3C */
  70.    "",            /* 0xFF3D */
  71.    "",            /* 0xFF3E */
  72.    "",            /* 0xFF3F */
  73.    "",            /* 0xFF40 */
  74.    "",            /* 0xFF41 */
  75.    "",            /* 0xFF42 */
  76.    "",            /* 0xFF43 */
  77.    "",            /* 0xFF44 */
  78.    "",            /* 0xFF45 */
  79.    "",            /* 0xFF46 */
  80.    "",            /* 0xFF47 */
  81.    "",            /* 0xFF48 */
  82.    "",            /* 0xFF49 */
  83.    "",            /* 0xFF4A */
  84.    "",            /* 0xFF4B */
  85.    "",            /* 0xFF4C */
  86.    "",            /* 0xFF4D */
  87.    "",            /* 0xFF4E */
  88.    "",            /* 0xFF4F */
  89.    "\001\001",        /* 0xFF50      XK_Home */
  90.    "\003\033[D",    /* 0xFF51      XK_Left */
  91.    "\003\033[A",    /* 0xFF52      XK_Up */
  92.    "\003\033[C",    /* 0xFF53      XK_Right */
  93.    "\003\033[B",    /* 0xFF54      XK_Down */
  94.    "\004\033[5~",    /* 0xFF55      XK_Prior */
  95.    "\004\033[6~",    /* 0xFF56      XK_Next */
  96.    "\001\005",        /* 0xFF57      XK_End */
  97.    "\001\001",        /* 0xFF58      XK_Begin */
  98.    "",            /* 0xFF59 */
  99.    "",            /* 0xFF5A */
  100.    "",            /* 0xFF5B */
  101.    "",            /* 0xFF5C */
  102.    "",            /* 0xFF5D */
  103.    "",            /* 0xFF5E */
  104.    "",            /* 0xFF5F */
  105.    "\004\033[4~",    /* 0xFF60      XK_Select */
  106.    "",            /* 0xFF61      XK_Print */
  107.    "",            /* 0xFF62      XK_Execute */
  108.    "\004\033[2~",    /* 0xFF63      XK_Insert */
  109.    "",            /* 0xFF64 */
  110.    "\002\037",        /* 0xFF65      XK_Undo      ^_ */
  111.    "",            /* 0xFF66      XK_Redo */
  112.    "\005\033[29~",    /* 0xFF67      XK_Menu         Do */
  113.    "\004\033[1~",    /* 0xFF68      XK_Find */
  114.    "\001\007",        /* 0xFF69      XK_Cancel */
  115.    "\005\033[28~",    /* 0xFF6A      XK_Help */
  116.    "",            /* 0xFF6B      XK_Break */
  117.    "",            /* 0xFF6C */
  118.    "",            /* 0xFF6D */
  119.    "",            /* 0xFF6E */
  120.    "",            /* 0xFF6F */
  121.    "",            /* 0xFF70 */
  122.    "",            /* 0xFF71 */
  123.    "",            /* 0xFF72 */
  124.    "",            /* 0xFF73 */
  125.    "",            /* 0xFF74 */
  126.    "",            /* 0xFF75 */
  127.    "",            /* 0xFF76 */
  128.    "",            /* 0xFF77 */
  129.    "",            /* 0xFF78 */
  130.    "",            /* 0xFF79 */
  131.    "",            /* 0xFF7A */
  132.    "",            /* 0xFF7B */
  133.    "",            /* 0xFF7C */
  134.    "",            /* 0xFF7D */
  135.    "",            /* 0xFF7E */
  136.    "",            /* 0xFF7F      XK_Num_Lock */
  137.    "",            /* 0xFF80      XK_KP_Space */
  138.    "",            /* 0xFF81 */
  139.    "",            /* 0xFF82 */
  140.    "",            /* 0xFF83 */
  141.    "",            /* 0xFF84 */
  142.    "",            /* 0xFF85 */
  143.    "",            /* 0xFF86 */
  144.    "",            /* 0xFF87 */
  145.    "",            /* 0xFF88 */
  146.    "",            /* 0xFF89      XK_KP_Tab */
  147.    "",            /* 0xFF8A */
  148.    "",            /* 0xFF8B */
  149.    "",            /* 0xFF8C */
  150.    "\003\033OM",    /* 0xFF8D      XK_KP_Enter */
  151.    "",            /* 0xFF8E */
  152.    "",            /* 0xFF8F */
  153.    "",            /* 0xFF90 */
  154.    "\003\033OP",    /* 0xFF91      XK_KP_F1        PF1 */
  155.    "\003\033OQ",    /* 0xFF92      XK_KP_F2        PF2 */
  156.    "\003\033OR",    /* 0xFF93      XK_KP_F3        PF3 */
  157.    "\003\033OS",    /* 0xFF94      XK_KP_F4        PF4 */
  158.    "",            /* 0xFF95 */
  159.    "",            /* 0xFF96 */
  160.    "",            /* 0xFF97 */
  161.    "",            /* 0xFF98 */
  162.    "",            /* 0xFF99 */
  163.    "",            /* 0xFF9A */
  164.    "",            /* 0xFF9B */
  165.    "",            /* 0xFF9C */
  166.    "",            /* 0xFF9D */
  167.    "",            /* 0xFF9E */
  168.    "",            /* 0xFF9F */
  169.    "",            /* 0xFFA0 */
  170.    "",            /* 0xFFA1 */
  171.    "",            /* 0xFFA2 */
  172.    "",            /* 0xFFA3 */
  173.    "",            /* 0xFFA4 */
  174.    "",            /* 0xFFA5 */
  175.    "",            /* 0xFFA6 */
  176.    "",            /* 0xFFA7 */
  177.    "",            /* 0xFFA8 */
  178.    "",            /* 0xFFA9 */
  179.    "",            /* 0xFFAA      XK_KP_Multiply */
  180.    "",            /* 0xFFAB      XK_KP_Add */
  181.    "\003\033Ol",    /* 0xFFAC      XK_KP_Separator KP , */
  182.    "\003\033Om",    /* 0xFFAD      XK_KP_Subtract  KP - */
  183.    "\003\033On",    /* 0xFFAE      XK_KP_Decimal   KP . */
  184.    "",            /* 0xFFAF      XK_KP_Divide */
  185.    "\003\033Op",    /* 0xFFB0      XK_KP_0 */
  186.    "\003\033Oq",    /* 0xFFB1      XK_KP_1 */
  187.    "\003\033Or",    /* 0xFFB2      XK_KP_2 */
  188.    "\003\033Os",    /* 0xFFB3      XK_KP_3 */
  189.    "\003\033Ot",    /* 0xFFB4      XK_KP_4 */
  190.    "\003\033Ou",    /* 0xFFB5      XK_KP_5 */
  191.    "\003\033Ov",    /* 0xFFB6      XK_KP_6 */
  192.    "\003\033Ow",    /* 0xFFB7      XK_KP_7 */
  193.    "\003\033Ox",    /* 0xFFB8      XK_KP_8 */
  194.    "\003\033Oy",    /* 0xFFB9      XK_KP_9 */
  195.    "",            /* 0xFFBA */
  196.    "",            /* 0xFFBB */
  197.    "",            /* 0xFFBC */
  198.    "",            /* 0xFFBD      XK_KP_Equal */
  199.  
  200.    "\005\033[11~",    /* 0xFFBE      XK_F1 */  /* xterm convention */
  201.    "\005\033[12~",    /* 0xFFBF      XK_F2 */  /* xterm convention */
  202.    "\005\033[13~",    /* 0xFFC0      XK_F3 */  /* xterm convention */
  203.    "\005\033[14~",    /* 0xFFC1      XK_F4 */  /* xterm convention */
  204.    "\005\033[15~",    /* 0xFFC2      XK_F5 */  /* xterm convention */
  205.    "\005\033[17~",    /* 0xFFC3      XK_F6 */
  206.    "\005\033[18~",    /* 0xFFC4      XK_F7 */
  207.    "\005\033[19~",    /* 0xFFC5      XK_F8 */
  208.    "\005\033[20~",    /* 0xFFC6      XK_F9 */
  209.    "\005\033[21~",    /* 0xFFC7      XK_F10 */
  210.    "\005\033[23~",    /* 0xFFC8      XK_F11      XK_L1 */
  211.    "\005\033[24~",    /* 0xFFC9      XK_F12      XK_L2 */
  212.    "\005\033[25~",    /* 0xFFCA      XK_F13      XK_L3 */
  213.    "\005\033[26~",    /* 0xFFCB      XK_F14      XK_L4 */
  214.    "\005\033[28~",    /* 0xFFCC      XK_F15      XK_L5 */
  215.    "\005\033[29~",    /* 0xFFCD      XK_F16      XK_L6 */
  216.    "\005\033[31~",    /* 0xFFCE      XK_F17      XK_L7 */
  217.    "\005\033[32~",    /* 0xFFCF      XK_F18      XK_L8 */
  218.    "\005\033[33~",    /* 0xFFD0      XK_F19      XK_L9 */
  219.    "\005\033[34~",    /* 0xFFD1      XK_F20      XK_L10 */
  220.    "\005\033[35~",    /* 0xFFD2      XK_F21      XK_R1 */
  221.    "\005\033[36~",    /* 0xFFD3      XK_F22      XK_R2 */
  222.    "\005\033[37~",    /* 0xFFD4      XK_F23      XK_R3 */
  223.    "\005\033[38~",    /* 0xFFD5      XK_F24      XK_R4 */
  224.    "\005\033[39~",    /* 0xFFD6      XK_F25      XK_R5 */
  225.    "\005\033[40~",    /* 0xFFD7      XK_F26      XK_R6 */
  226.    "\005\033[41~",    /* 0xFFD8      XK_F27      XK_R7 */
  227.    "\005\033[42~",    /* 0xFFD9      XK_F28      XK_R8 */
  228.    "\005\033[43~",    /* 0xFFDA      XK_F29      XK_R9 */
  229.    "\005\033[44~",    /* 0xFFDB      XK_F30      XK_R10 */
  230.    "\005\033[45~",    /* 0xFFDC      XK_F31      XK_R11 */
  231.    "\005\033[46~",    /* 0xFFDD      XK_F32      XK_R12 */
  232.    "\005\033[47~",    /* 0xFFDE      XK_R13      XK_F33 */
  233.    "\005\033[48~",    /* 0xFFDF      XK_F34      XK_R14 */
  234.    "\005\033[49~",    /* 0xFFE0      XK_F35      XK_R15 */
  235.    "",            /* 0xFFE1      XK_Shift_L      XK_Shift_L */
  236.    "",            /* 0xFFE2      XK_Shift_R */
  237.    "",            /* 0xFFE3      XK_Control_L */
  238.    "",            /* 0xFFE4      XK_Control_R */
  239.    "",            /* 0xFFE5      XK_Caps_Lock */
  240.    "",            /* 0xFFE6      XK_Shift_Lock */
  241.    "",            /* 0xFFE7      XK_Meta_L */
  242.    "",            /* 0xFFE8      XK_Meta_R */
  243.    "",            /* 0xFFE9      XK_Alt_L */
  244.    "",            /* 0xFFEA      XK_Alt_R */
  245.    "",            /* 0xFFEB      XK_Super_L */
  246.    "",            /* 0xFFEC      XK_Super_R */
  247.    "",            /* 0xFFED      XK_Hyper_L */
  248.    "",            /* 0xFFEE      XK_Hyper_R */
  249.    "",            /* 0xFFEF */
  250.    "",            /* 0xFFF0 */
  251.    "",            /* 0xFFF1 */
  252.    "",            /* 0xFFF2 */
  253.    "",            /* 0xFFF3 */
  254.    "",            /* 0xFFF4 */
  255.    "",            /* 0xFFF5 */
  256.    "",            /* 0xFFF6 */
  257.    "",            /* 0xFFF7 */
  258.    "",            /* 0xFFF8 */
  259.    "",            /* 0xFFF9 */
  260.    "",            /* 0xFFFA */
  261.    "",            /* 0xFFFB */
  262.    "",            /* 0xFFFC */
  263.    "",            /* 0xFFFD */
  264.    "",            /* 0xFFFE */
  265.    "\001\177"        /* 0xFFFF      XK_Delete */
  266. };
  267.  
  268. static KeySym_Mapping_Type Shift_KeySym_Mapping[256] =
  269. {
  270.    "\004\033[3$",    /* 0xFF00                        Remove */
  271.    "",            /* 0xFF01 */
  272.    "",            /* 0xFF02 */
  273.    "",            /* 0xFF03 */
  274.    "",            /* 0xFF04 */
  275.    "",            /* 0xFF05 */
  276.    "",            /* 0xFF06 */
  277.    "",            /* 0xFF07 */
  278.    "\001\177",        /* 0xFF08      XK_BackSpace */
  279.    "\001\t",        /* 0xFF09      XK_Tab */
  280.    "\001\n",        /* 0xFF0A      XK_Linefeed */
  281.    "",            /* 0xFF0B      XK_Clear */
  282.    "",            /* 0xFF0C */
  283.    "\001\r",        /* 0xFF0D      XK_Return */
  284.    "",            /* 0xFF0E */
  285.    "",            /* 0xFF0F */
  286.    "",            /* 0xFF10 */
  287.    "",            /* 0xFF11 */
  288.    "",            /* 0xFF12 */
  289.    "",            /* 0xFF13      XK_Pause */
  290.    "",            /* 0xFF14      XK_Scroll_Lock */
  291.    "",            /* 0xFF15 */
  292.    "",            /* 0xFF16 */
  293.    "",            /* 0xFF17 */
  294.    "",            /* 0xFF18 */
  295.    "",            /* 0xFF19 */
  296.    "",            /* 0xFF1A */
  297.    "\001\033",        /* 0xFF1B      XK_Escape */
  298.    "",            /* 0xFF1C */
  299.    "",            /* 0xFF1D */
  300.    "",            /* 0xFF1E */
  301.    "",            /* 0xFF1F */
  302.    "",            /* 0xFF20      XK_Multi_key */
  303.    "",            /* 0xFF21      XK_Kanji */
  304.    "",            /* 0xFF22      XK_Muhenkan */
  305.    "",            /* 0xFF23      XK_Henkan_Mode      XK_Henkan */
  306.    "",            /* 0xFF24      XK_Romaji */
  307.    "",            /* 0xFF25      XK_Hiragana */
  308.    "",            /* 0xFF26      XK_Katakana */
  309.    "",            /* 0xFF27      XK_Hiragana_Katakana */
  310.    "",            /* 0xFF28      XK_Zenkaku */
  311.    "",            /* 0xFF29      XK_Hankaku */
  312.    "",            /* 0xFF2A      XK_Zenkaku_Hankaku */
  313.    "",            /* 0xFF2B      XK_Touroku */
  314.    "",            /* 0xFF2C      XK_Massyo */
  315.    "",            /* 0xFF2D      XK_Kana_Lock */
  316.    "",            /* 0xFF2E      XK_Kana_Shift */
  317.    "",            /* 0xFF2F      XK_Eisu_Shift */
  318.    "",            /* 0xFF30      XK_Eisu_toggle */
  319.    "",            /* 0xFF31 */
  320.    "",            /* 0xFF32 */
  321.    "",            /* 0xFF33 */
  322.    "",            /* 0xFF34 */
  323.    "",            /* 0xFF35 */
  324.    "",            /* 0xFF36 */
  325.    "",            /* 0xFF37 */
  326.    "",            /* 0xFF38 */
  327.    "",            /* 0xFF39 */
  328.    "",            /* 0xFF3A */
  329.    "",            /* 0xFF3B */
  330.    "",            /* 0xFF3C */
  331.    "",            /* 0xFF3D */
  332.    "",            /* 0xFF3E */
  333.    "",            /* 0xFF3F */
  334.    "",            /* 0xFF40 */
  335.    "",            /* 0xFF41 */
  336.    "",            /* 0xFF42 */
  337.    "",            /* 0xFF43 */
  338.    "",            /* 0xFF44 */
  339.    "",            /* 0xFF45 */
  340.    "",            /* 0xFF46 */
  341.    "",            /* 0xFF47 */
  342.    "",            /* 0xFF48 */
  343.    "",            /* 0xFF49 */
  344.    "",            /* 0xFF4A */
  345.    "",            /* 0xFF4B */
  346.    "",            /* 0xFF4C */
  347.    "",            /* 0xFF4D */
  348.    "",            /* 0xFF4E */
  349.    "",            /* 0xFF4F */
  350.    "\001\001",        /* 0xFF50      XK_Home */
  351.    "\003\033[d",    /* 0xFF51      XK_Left */
  352.    "\003\033[a",    /* 0xFF52      XK_Up */
  353.    "\003\033[c",    /* 0xFF53      XK_Right */
  354.    "\003\033[b",    /* 0xFF54      XK_Down */
  355.    "\004\033[5$",    /* 0xFF55      XK_Prior */
  356.    "\004\033[6$",    /* 0xFF56      XK_Next */
  357.    "\001\005",        /* 0xFF57      XK_End */
  358.    "\001\001",        /* 0xFF58      XK_Begin */
  359.    "",            /* 0xFF59 */
  360.    "",            /* 0xFF5A */
  361.    "",            /* 0xFF5B */
  362.    "",            /* 0xFF5C */
  363.    "",            /* 0xFF5D */
  364.    "",            /* 0xFF5E */
  365.    "",            /* 0xFF5F */
  366.    "\004\033[4$",    /* 0xFF60      XK_Select */
  367.    "",            /* 0xFF61      XK_Print */
  368.    "",            /* 0xFF62      XK_Execute */
  369.    "\004\033[2$",    /* 0xFF63      XK_Insert */
  370.    "",            /* 0xFF64 */
  371.    "\002\037",        /* 0xFF65      XK_Undo      ^_ */
  372.    "",            /* 0xFF66      XK_Redo */
  373.    "\005\033[29$",    /* 0xFF67      XK_Menu         Do */
  374.    "\004\033[1$",    /* 0xFF68      XK_Find */
  375.    "\001\007",        /* 0xFF69      XK_Cancel */
  376.    "\005\033[28$",    /* 0xFF6A      XK_Help */
  377.    "",            /* 0xFF6B      XK_Break */
  378.    "",            /* 0xFF6C */
  379.    "",            /* 0xFF6D */
  380.    "",            /* 0xFF6E */
  381.    "",            /* 0xFF6F */
  382.    "",            /* 0xFF70 */
  383.    "",            /* 0xFF71 */
  384.    "",            /* 0xFF72 */
  385.    "",            /* 0xFF73 */
  386.    "",            /* 0xFF74 */
  387.    "",            /* 0xFF75 */
  388.    "",            /* 0xFF76 */
  389.    "",            /* 0xFF77 */
  390.    "",            /* 0xFF78 */
  391.    "",            /* 0xFF79 */
  392.    "",            /* 0xFF7A */
  393.    "",            /* 0xFF7B */
  394.    "",            /* 0xFF7C */
  395.    "",            /* 0xFF7D */
  396.    "",            /* 0xFF7E */
  397.    "",            /* 0xFF7F      XK_Num_Lock */
  398.    "",            /* 0xFF80      XK_KP_Space */
  399.    "",            /* 0xFF81 */
  400.    "",            /* 0xFF82 */
  401.    "",            /* 0xFF83 */
  402.    "",            /* 0xFF84 */
  403.    "",            /* 0xFF85 */
  404.    "",            /* 0xFF86 */
  405.    "",            /* 0xFF87 */
  406.    "",            /* 0xFF88 */
  407.    "",            /* 0xFF89      XK_KP_Tab */
  408.    "",            /* 0xFF8A */
  409.    "",            /* 0xFF8B */
  410.    "",            /* 0xFF8C */
  411.    "\003\033OM",    /* 0xFF8D      XK_KP_Enter */
  412.    "",            /* 0xFF8E */
  413.    "",            /* 0xFF8F */
  414.    "",            /* 0xFF90 */
  415.    "\003\033OP",    /* 0xFF91      XK_KP_F1        PF1 */
  416.    "\003\033OQ",    /* 0xFF92      XK_KP_F2        PF2 */
  417.    "\003\033OR",    /* 0xFF93      XK_KP_F3        PF3 */
  418.    "\003\033OS",    /* 0xFF94      XK_KP_F4        PF4 */
  419.    "",            /* 0xFF95 */
  420.    "",            /* 0xFF96 */
  421.    "",            /* 0xFF97 */
  422.    "",            /* 0xFF98 */
  423.    "",            /* 0xFF99 */
  424.    "",            /* 0xFF9A */
  425.    "",            /* 0xFF9B */
  426.    "",            /* 0xFF9C */
  427.    "",            /* 0xFF9D */
  428.    "",            /* 0xFF9E */
  429.    "",            /* 0xFF9F */
  430.    "",            /* 0xFFA0 */
  431.    "",            /* 0xFFA1 */
  432.    "",            /* 0xFFA2 */
  433.    "",            /* 0xFFA3 */
  434.    "",            /* 0xFFA4 */
  435.    "",            /* 0xFFA5 */
  436.    "",            /* 0xFFA6 */
  437.    "",            /* 0xFFA7 */
  438.    "",            /* 0xFFA8 */
  439.    "",            /* 0xFFA9 */
  440.    "",            /* 0xFFAA      XK_KP_Multiply */
  441.    "",            /* 0xFFAB      XK_KP_Add */
  442.    "\003\033Ol",    /* 0xFFAC      XK_KP_Separator KP , */
  443.    "\003\033Om",    /* 0xFFAD      XK_KP_Subtract  KP - */
  444.    "\003\033On",    /* 0xFFAE      XK_KP_Decimal   KP . */
  445.    "",            /* 0xFFAF      XK_KP_Divide */
  446.    "\003\033Op",    /* 0xFFB0      XK_KP_0 */
  447.    "\003\033Oq",    /* 0xFFB1      XK_KP_1 */
  448.    "\003\033Or",    /* 0xFFB2      XK_KP_2 */
  449.    "\003\033Os",    /* 0xFFB3      XK_KP_3 */
  450.    "\003\033Ot",    /* 0xFFB4      XK_KP_4 */
  451.    "\003\033Ou",    /* 0xFFB5      XK_KP_5 */
  452.    "\003\033Ov",    /* 0xFFB6      XK_KP_6 */
  453.    "\003\033Ow",    /* 0xFFB7      XK_KP_7 */
  454.    "\003\033Ox",    /* 0xFFB8      XK_KP_8 */
  455.    "\003\033Oy",    /* 0xFFB9      XK_KP_9 */
  456.    "",            /* 0xFFBA */
  457.    "",            /* 0xFFBB */
  458.    "",            /* 0xFFBC */
  459.    "",            /* 0xFFBD      XK_KP_Equal */
  460.    "\005\033[12$",    /* 0xFFBE      XK_F1 */
  461.    "\005\033[13$",    /* 0xFFBF      XK_F2 */
  462.    "\005\033[14$",    /* 0xFFC0      XK_F3 */
  463.    "\005\033[15$",    /* 0xFFC1      XK_F4 */
  464.    "\005\033[16$",    /* 0xFFC2      XK_F5 */
  465.    "\005\033[17$",    /* 0xFFC3      XK_F6 */
  466.    "\005\033[18$",    /* 0xFFC4      XK_F7 */
  467.    "\005\033[19$",    /* 0xFFC5      XK_F8 */
  468.    "\005\033[20$",    /* 0xFFC6      XK_F9 */
  469.    "\005\033[21$",    /* 0xFFC7      XK_F10 */
  470.    "\005\033[23$",    /* 0xFFC8      XK_F11      XK_L1 */
  471.    "\005\033[24$",    /* 0xFFC9      XK_F12      XK_L2 */
  472.    "\005\033[25$",    /* 0xFFCA      XK_F13      XK_L3 */
  473.    "\005\033[26$",    /* 0xFFCB      XK_F14      XK_L4 */
  474.    "\005\033[27$",    /* 0xFFCC      XK_F15      XK_L5 */
  475.    "\005\033[28$",    /* 0xFFCD      XK_F16      XK_L6 */
  476.    "\005\033[31$",    /* 0xFFCE      XK_F17      XK_L7 */
  477.    "\005\033[32$",    /* 0xFFCF      XK_F18      XK_L8 */
  478.    "\005\033[33$",    /* 0xFFD0      XK_F19      XK_L9 */
  479.    "\005\033[34$",    /* 0xFFD1      XK_F20      XK_L10 */
  480.    "\005\033[35$",    /* 0xFFD2      XK_F21      XK_R1 */
  481.    "\005\033[36$",    /* 0xFFD3      XK_F22      XK_R2 */
  482.    "\005\033[37$",    /* 0xFFD4      XK_F23      XK_R3 */
  483.    "\005\033[38$",    /* 0xFFD5      XK_F24      XK_R4 */
  484.    "\005\033[39$",    /* 0xFFD6      XK_F25      XK_R5 */
  485.    "\005\033[40$",    /* 0xFFD7      XK_F26      XK_R6 */
  486.    "\005\033[41$",    /* 0xFFD8      XK_F27      XK_R7 */
  487.    "\005\033[42$",    /* 0xFFD9      XK_F28      XK_R8 */
  488.    "\005\033[43$",    /* 0xFFDA      XK_F29      XK_R9 */
  489.    "\005\033[44$",    /* 0xFFDB      XK_F30      XK_R10 */
  490.    "\005\033[45$",    /* 0xFFDC      XK_F31      XK_R11 */
  491.    "\005\033[46$",    /* 0xFFDD      XK_F32      XK_R12 */
  492.    "\005\033[47$",    /* 0xFFDE      XK_R13      XK_F33 */
  493.    "\005\033[48$",    /* 0xFFDF      XK_F34      XK_R14 */
  494.    "\005\033[49$",    /* 0xFFE0      XK_F35      XK_R15 */
  495.    "",            /* 0xFFE1      XK_Shift_L      XK_Shift_L */
  496.    "",            /* 0xFFE2      XK_Shift_R */
  497.    "",            /* 0xFFE3      XK_Control_L */
  498.    "",            /* 0xFFE4      XK_Control_R */
  499.    "",            /* 0xFFE5      XK_Caps_Lock */
  500.    "",            /* 0xFFE6      XK_Shift_Lock */
  501.    "",            /* 0xFFE7      XK_Meta_L */
  502.    "",            /* 0xFFE8      XK_Meta_R */
  503.    "",            /* 0xFFE9      XK_Alt_L */
  504.    "",            /* 0xFFEA      XK_Alt_R */
  505.    "",            /* 0xFFEB      XK_Super_L */
  506.    "",            /* 0xFFEC      XK_Super_R */
  507.    "",            /* 0xFFED      XK_Hyper_L */
  508.    "",            /* 0xFFEE      XK_Hyper_R */
  509.    "",            /* 0xFFEF */
  510.    "",            /* 0xFFF0 */
  511.    "",            /* 0xFFF1 */
  512.    "",            /* 0xFFF2 */
  513.    "",            /* 0xFFF3 */
  514.    "",            /* 0xFFF4 */
  515.    "",            /* 0xFFF5 */
  516.    "",            /* 0xFFF6 */
  517.    "",            /* 0xFFF7 */
  518.    "",            /* 0xFFF8 */
  519.    "",            /* 0xFFF9 */
  520.    "",            /* 0xFFFA */
  521.    "",            /* 0xFFFB */
  522.    "",            /* 0xFFFC */
  523.    "",            /* 0xFFFD */
  524.    "",            /* 0xFFFE */
  525.    "\001\177"        /* 0xFFFF      XK_Delete */
  526. };
  527.  
  528. static KeySym_Mapping_Type Control_KeySym_Mapping[256] =
  529. {
  530.    "\004\033[3^",    /* 0xFF00                        Remove */
  531.    "",            /* 0xFF01 */
  532.    "",            /* 0xFF02 */
  533.    "",            /* 0xFF03 */
  534.    "",            /* 0xFF04 */
  535.    "",            /* 0xFF05 */
  536.    "",            /* 0xFF06 */
  537.    "",            /* 0xFF07 */
  538.    "\001\177",        /* 0xFF08      XK_BackSpace */
  539.    "\001\t",        /* 0xFF09      XK_Tab */
  540.    "\001\n",        /* 0xFF0A      XK_Linefeed */
  541.    "",            /* 0xFF0B      XK_Clear */
  542.    "",            /* 0xFF0C */
  543.    "\001\r",        /* 0xFF0D      XK_Return */
  544.    "",            /* 0xFF0E */
  545.    "",            /* 0xFF0F */
  546.    "",            /* 0xFF10 */
  547.    "",            /* 0xFF11 */
  548.    "",            /* 0xFF12 */
  549.    "",            /* 0xFF13      XK_Pause */
  550.    "",            /* 0xFF14      XK_Scroll_Lock */
  551.    "",            /* 0xFF15 */
  552.    "",            /* 0xFF16 */
  553.    "",            /* 0xFF17 */
  554.    "",            /* 0xFF18 */
  555.    "",            /* 0xFF19 */
  556.    "",            /* 0xFF1A */
  557.    "\001\033",        /* 0xFF1B      XK_Escape */
  558.    "",            /* 0xFF1C */
  559.    "",            /* 0xFF1D */
  560.    "",            /* 0xFF1E */
  561.    "",            /* 0xFF1F */
  562.    "",            /* 0xFF20      XK_Multi_key */
  563.    "",            /* 0xFF21      XK_Kanji */
  564.    "",            /* 0xFF22      XK_Muhenkan */
  565.    "",            /* 0xFF23      XK_Henkan_Mode      XK_Henkan */
  566.    "",            /* 0xFF24      XK_Romaji */
  567.    "",            /* 0xFF25      XK_Hiragana */
  568.    "",            /* 0xFF26      XK_Katakana */
  569.    "",            /* 0xFF27      XK_Hiragana_Katakana */
  570.    "",            /* 0xFF28      XK_Zenkaku */
  571.    "",            /* 0xFF29      XK_Hankaku */
  572.    "",            /* 0xFF2A      XK_Zenkaku_Hankaku */
  573.    "",            /* 0xFF2B      XK_Touroku */
  574.    "",            /* 0xFF2C      XK_Massyo */
  575.    "",            /* 0xFF2D      XK_Kana_Lock */
  576.    "",            /* 0xFF2E      XK_Kana_Shift */
  577.    "",            /* 0xFF2F      XK_Eisu_Shift */
  578.    "",            /* 0xFF30      XK_Eisu_toggle */
  579.    "",            /* 0xFF31 */
  580.    "",            /* 0xFF32 */
  581.    "",            /* 0xFF33 */
  582.    "",            /* 0xFF34 */
  583.    "",            /* 0xFF35 */
  584.    "",            /* 0xFF36 */
  585.    "",            /* 0xFF37 */
  586.    "",            /* 0xFF38 */
  587.    "",            /* 0xFF39 */
  588.    "",            /* 0xFF3A */
  589.    "",            /* 0xFF3B */
  590.    "",            /* 0xFF3C */
  591.    "",            /* 0xFF3D */
  592.    "",            /* 0xFF3E */
  593.    "",            /* 0xFF3F */
  594.    "",            /* 0xFF40 */
  595.    "",            /* 0xFF41 */
  596.    "",            /* 0xFF42 */
  597.    "",            /* 0xFF43 */
  598.    "",            /* 0xFF44 */
  599.    "",            /* 0xFF45 */
  600.    "",            /* 0xFF46 */
  601.    "",            /* 0xFF47 */
  602.    "",            /* 0xFF48 */
  603.    "",            /* 0xFF49 */
  604.    "",            /* 0xFF4A */
  605.    "",            /* 0xFF4B */
  606.    "",            /* 0xFF4C */
  607.    "",            /* 0xFF4D */
  608.    "",            /* 0xFF4E */
  609.    "",            /* 0xFF4F */
  610.    "\001\001",        /* 0xFF50      XK_Home */
  611.    "\003\033[\004",    /* 0xFF51      XK_Left */
  612.    "\003\033[\001",    /* 0xFF52      XK_Up */
  613.    "\003\033[\003",    /* 0xFF53      XK_Right */
  614.    "\003\033[\002",    /* 0xFF54      XK_Down */
  615.    "\004\033[5^",    /* 0xFF55      XK_Prior */
  616.    "\004\033[6^",    /* 0xFF56      XK_Next */
  617.    "\001\005",        /* 0xFF57      XK_End */
  618.    "\001\001",        /* 0xFF58      XK_Begin */
  619.    "",            /* 0xFF59 */
  620.    "",            /* 0xFF5A */
  621.    "",            /* 0xFF5B */
  622.    "",            /* 0xFF5C */
  623.    "",            /* 0xFF5D */
  624.    "",            /* 0xFF5E */
  625.    "",            /* 0xFF5F */
  626.    "\004\033[4^",    /* 0xFF60      XK_Select */
  627.    "",            /* 0xFF61      XK_Print */
  628.    "",            /* 0xFF62      XK_Execute */
  629.    "\004\033[2^",    /* 0xFF63      XK_Insert */
  630.    "",            /* 0xFF64 */
  631.    "\002\037",        /* 0xFF65      XK_Undo      ^_ */
  632.    "",            /* 0xFF66      XK_Redo */
  633.    "\005\033[29^",    /* 0xFF67      XK_Menu         Do */
  634.    "\004\033[1^",    /* 0xFF68      XK_Find */
  635.    "\001\007",        /* 0xFF69      XK_Cancel */
  636.    "\005\033[28^",    /* 0xFF6A      XK_Help */
  637.    "",            /* 0xFF6B      XK_Break */
  638.    "",            /* 0xFF6C */
  639.    "",            /* 0xFF6D */
  640.    "",            /* 0xFF6E */
  641.    "",            /* 0xFF6F */
  642.    "",            /* 0xFF70 */
  643.    "",            /* 0xFF71 */
  644.    "",            /* 0xFF72 */
  645.    "",            /* 0xFF73 */
  646.    "",            /* 0xFF74 */
  647.    "",            /* 0xFF75 */
  648.    "",            /* 0xFF76 */
  649.    "",            /* 0xFF77 */
  650.    "",            /* 0xFF78 */
  651.    "",            /* 0xFF79 */
  652.    "",            /* 0xFF7A */
  653.    "",            /* 0xFF7B */
  654.    "",            /* 0xFF7C */
  655.    "",            /* 0xFF7D */
  656.    "",            /* 0xFF7E */
  657.    "",            /* 0xFF7F      XK_Num_Lock */
  658.    "",            /* 0xFF80      XK_KP_Space */
  659.    "",            /* 0xFF81 */
  660.    "",            /* 0xFF82 */
  661.    "",            /* 0xFF83 */
  662.    "",            /* 0xFF84 */
  663.    "",            /* 0xFF85 */
  664.    "",            /* 0xFF86 */
  665.    "",            /* 0xFF87 */
  666.    "",            /* 0xFF88 */
  667.    "",            /* 0xFF89      XK_KP_Tab */
  668.    "",            /* 0xFF8A */
  669.    "",            /* 0xFF8B */
  670.    "",            /* 0xFF8C */
  671.    "\003\033OM",    /* 0xFF8D      XK_KP_Enter */
  672.    "",            /* 0xFF8E */
  673.    "",            /* 0xFF8F */
  674.    "",            /* 0xFF90 */
  675.    "\003\033OP",    /* 0xFF91      XK_KP_F1        PF1 */
  676.    "\003\033OQ",    /* 0xFF92      XK_KP_F2        PF2 */
  677.    "\003\033OR",    /* 0xFF93      XK_KP_F3        PF3 */
  678.    "\003\033OS",    /* 0xFF94      XK_KP_F4        PF4 */
  679.    "",            /* 0xFF95 */
  680.    "",            /* 0xFF96 */
  681.    "",            /* 0xFF97 */
  682.    "",            /* 0xFF98 */
  683.    "",            /* 0xFF99 */
  684.    "",            /* 0xFF9A */
  685.    "",            /* 0xFF9B */
  686.    "",            /* 0xFF9C */
  687.    "",            /* 0xFF9D */
  688.    "",            /* 0xFF9E */
  689.    "",            /* 0xFF9F */
  690.    "",            /* 0xFFA0 */
  691.    "",            /* 0xFFA1 */
  692.    "",            /* 0xFFA2 */
  693.    "",            /* 0xFFA3 */
  694.    "",            /* 0xFFA4 */
  695.    "",            /* 0xFFA5 */
  696.    "",            /* 0xFFA6 */
  697.    "",            /* 0xFFA7 */
  698.    "",            /* 0xFFA8 */
  699.    "",            /* 0xFFA9 */
  700.    "",            /* 0xFFAA      XK_KP_Multiply */
  701.    "",            /* 0xFFAB      XK_KP_Add */
  702.    "\003\033Ol",    /* 0xFFAC      XK_KP_Separator KP , */
  703.    "\003\033Om",    /* 0xFFAD      XK_KP_Subtract  KP - */
  704.    "\003\033On",    /* 0xFFAE      XK_KP_Decimal   KP . */
  705.    "",            /* 0xFFAF      XK_KP_Divide */
  706.    "\003\033Op",    /* 0xFFB0      XK_KP_0 */
  707.    "\003\033Oq",    /* 0xFFB1      XK_KP_1 */
  708.    "\003\033Or",    /* 0xFFB2      XK_KP_2 */
  709.    "\003\033Os",    /* 0xFFB3      XK_KP_3 */
  710.    "\003\033Ot",    /* 0xFFB4      XK_KP_4 */
  711.    "\003\033Ou",    /* 0xFFB5      XK_KP_5 */
  712.    "\003\033Ov",    /* 0xFFB6      XK_KP_6 */
  713.    "\003\033Ow",    /* 0xFFB7      XK_KP_7 */
  714.    "\003\033Ox",    /* 0xFFB8      XK_KP_8 */
  715.    "\003\033Oy",    /* 0xFFB9      XK_KP_9 */
  716.    "",            /* 0xFFBA */
  717.    "",            /* 0xFFBB */
  718.    "",            /* 0xFFBC */
  719.    "",            /* 0xFFBD      XK_KP_Equal */
  720.    "\005\033[12^",    /* 0xFFBE      XK_F1 */
  721.    "\005\033[13^",    /* 0xFFBF      XK_F2 */
  722.    "\005\033[14^",    /* 0xFFC0      XK_F3 */
  723.    "\005\033[15^",    /* 0xFFC1      XK_F4 */
  724.    "\005\033[16^",    /* 0xFFC2      XK_F5 */
  725.    "\005\033[17^",    /* 0xFFC3      XK_F6 */
  726.    "\005\033[18^",    /* 0xFFC4      XK_F7 */
  727.    "\005\033[19^",    /* 0xFFC5      XK_F8 */
  728.    "\005\033[20^",    /* 0xFFC6      XK_F9 */
  729.    "\005\033[21^",    /* 0xFFC7      XK_F10 */
  730.    "\005\033[23^",    /* 0xFFC8      XK_F11      XK_L1 */
  731.    "\005\033[24^",    /* 0xFFC9      XK_F12      XK_L2 */
  732.    "\005\033[25^",    /* 0xFFCA      XK_F13      XK_L3 */
  733.    "\005\033[26^",    /* 0xFFCB      XK_F14      XK_L4 */
  734.    "\005\033[27^",    /* 0xFFCC      XK_F15      XK_L5 */
  735.    "\005\033[28^",    /* 0xFFCD      XK_F16      XK_L6 */
  736.    "\005\033[31^",    /* 0xFFCE      XK_F17      XK_L7 */
  737.    "\005\033[32^",    /* 0xFFCF      XK_F18      XK_L8 */
  738.    "\005\033[33^",    /* 0xFFD0      XK_F19      XK_L9 */
  739.    "\005\033[34^",    /* 0xFFD1      XK_F20      XK_L10 */
  740.    "\005\033[35^",    /* 0xFFD2      XK_F21      XK_R1 */
  741.    "\005\033[36^",    /* 0xFFD3      XK_F22      XK_R2 */
  742.    "\005\033[37^",    /* 0xFFD4      XK_F23      XK_R3 */
  743.    "\005\033[38^",    /* 0xFFD5      XK_F24      XK_R4 */
  744.    "\005\033[39^",    /* 0xFFD6      XK_F25      XK_R5 */
  745.    "\005\033[40^",    /* 0xFFD7      XK_F26      XK_R6 */
  746.    "\005\033[41^",    /* 0xFFD8      XK_F27      XK_R7 */
  747.    "\005\033[42^",    /* 0xFFD9      XK_F28      XK_R8 */
  748.    "\005\033[43^",    /* 0xFFDA      XK_F29      XK_R9 */
  749.    "\005\033[44^",    /* 0xFFDB      XK_F30      XK_R10 */
  750.    "\005\033[45^",    /* 0xFFDC      XK_F31      XK_R11 */
  751.    "\005\033[46^",    /* 0xFFDD      XK_F32      XK_R12 */
  752.    "\005\033[47^",    /* 0xFFDE      XK_R13      XK_F33 */
  753.    "\005\033[48^",    /* 0xFFDF      XK_F34      XK_R14 */
  754.    "\005\033[49^",    /* 0xFFE0      XK_F35      XK_R15 */
  755.    "",            /* 0xFFE1      XK_Shift_L      XK_Shift_L */
  756.    "",            /* 0xFFE2      XK_Shift_R */
  757.    "",            /* 0xFFE3      XK_Control_L */
  758.    "",            /* 0xFFE4      XK_Control_R */
  759.    "",            /* 0xFFE5      XK_Caps_Lock */
  760.    "",            /* 0xFFE6      XK_Shift_Lock */
  761.    "",            /* 0xFFE7      XK_Meta_L */
  762.    "",            /* 0xFFE8      XK_Meta_R */
  763.    "",            /* 0xFFE9      XK_Alt_L */
  764.    "",            /* 0xFFEA      XK_Alt_R */
  765.    "",            /* 0xFFEB      XK_Super_L */
  766.    "",            /* 0xFFEC      XK_Super_R */
  767.    "",            /* 0xFFED      XK_Hyper_L */
  768.    "",            /* 0xFFEE      XK_Hyper_R */
  769.    "",            /* 0xFFEF */
  770.    "",            /* 0xFFF0 */
  771.    "",            /* 0xFFF1 */
  772.    "",            /* 0xFFF2 */
  773.    "",            /* 0xFFF3 */
  774.    "",            /* 0xFFF4 */
  775.    "",            /* 0xFFF5 */
  776.    "",            /* 0xFFF6 */
  777.    "",            /* 0xFFF7 */
  778.    "",            /* 0xFFF8 */
  779.    "",            /* 0xFFF9 */
  780.    "",            /* 0xFFFA */
  781.    "",            /* 0xFFFB */
  782.    "",            /* 0xFFFC */
  783.    "",            /* 0xFFFD */
  784.    "",            /* 0xFFFE */
  785.    "\001\177"        /* 0xFFFF      XK_Delete */
  786. };
  787.  
  788.