
Function X11ConvertKeySymToUnicode(sym : TKeySym) : Integer;

Begin
  If (sym >= $20) And (sym <= $7E) Then
    Exit(sym);
{  Case sym Of
    XK_BackSpace : Exit(8);
    XK_Tab : Exit(9);
    XK_Return : Exit(13);
    XK_Escape : Exit(27);
  End;}
  Case sym Of
    XKc_Cyrillic_GHE_bar           : Exit($492);
    XK_Cyrillic_ghe_bar            : Exit($493);
    XKc_Cyrillic_ZHE_descender     : Exit($496);
    XK_Cyrillic_zhe_descender      : Exit($497);
    XKc_Cyrillic_KA_descender      : Exit($49A);
    XK_Cyrillic_ka_descender       : Exit($49B);
    XKc_Cyrillic_KA_vertstroke     : Exit($49C);
    XK_Cyrillic_ka_vertstroke      : Exit($49D);
    XKc_Cyrillic_EN_descender      : Exit($4A2);
    XK_Cyrillic_en_descender       : Exit($4A3);
    XKc_Cyrillic_U_straight        : Exit($4AE);
    XK_Cyrillic_u_straight         : Exit($4AF);
    XKc_Cyrillic_U_straight_bar    : Exit($4B0);
    XK_Cyrillic_u_straight_bar     : Exit($4B1);
    XKc_Cyrillic_HA_descender      : Exit($4B2);
    XK_Cyrillic_ha_descender       : Exit($4B3);
    XKc_Cyrillic_CHE_descender     : Exit($4B6);
    XK_Cyrillic_che_descender      : Exit($4B7);
    XKc_Cyrillic_CHE_vertstroke    : Exit($4B8);
    XK_Cyrillic_che_vertstroke     : Exit($4B9);
    XKc_Cyrillic_SHHA              : Exit($4BA);
    XK_Cyrillic_shha               : Exit($4BB);

    XKc_Cyrillic_SCHWA             : Exit($4D8);
    XK_Cyrillic_schwa              : Exit($4D9);
    XKc_Cyrillic_I_macron          : Exit($4E2);
    XK_Cyrillic_i_macron           : Exit($4E3);
    XKc_Cyrillic_O_bar             : Exit($4E8);
    XK_Cyrillic_o_bar              : Exit($4E9);
    XKc_Cyrillic_U_macron          : Exit($4EE);
    XK_Cyrillic_u_macron           : Exit($4EF);

    XK_Serbian_dje                 : Exit($452);
    XK_Macedonia_gje               : Exit($453);
    XK_Cyrillic_io                 : Exit($451);
    XK_Ukrainian_ie                : Exit($454);
    XK_Macedonia_dse               : Exit($455);
    XK_Ukrainian_i                 : Exit($456);
    XK_Ukrainian_yi                : Exit($457);
    XK_Cyrillic_je                 : Exit($458);
    XK_Cyrillic_lje                : Exit($459);
    XK_Cyrillic_nje                : Exit($45A);
    XK_Serbian_tshe                : Exit($45B);
    XK_Macedonia_kje               : Exit($45C);
    XK_Ukrainian_ghe_with_upturn   : Exit($491);
    XK_Byelorussian_shortu         : Exit($45E);
    XK_Cyrillic_dzhe               : Exit($45F);
    XK_numerosign                  : Exit($2116);
    XKc_Serbian_DJE                : Exit($402);
    XKc_Macedonia_GJE              : Exit($403);
    XKc_Cyrillic_IO                : Exit($401);
    XKc_Ukrainian_IE               : Exit($404);
    XKc_Macedonia_DSE              : Exit($405);
    XKc_Ukrainian_I                : Exit($406);
    XKc_Ukrainian_YI               : Exit($407);
    XKc_Cyrillic_JE                : Exit($408);
    XKc_Cyrillic_LJE               : Exit($409);
    XKc_Cyrillic_NJE               : Exit($40A);
    XKc_Serbian_TSHE               : Exit($40B);
    XKc_Macedonia_KJE              : Exit($40C);
    XKc_Ukrainian_GHE_WITH_UPTURN  : Exit($490);
    XKc_Byelorussian_SHORTU        : Exit($40E);
    XKc_Cyrillic_DZHE              : Exit($40F);
    XK_Cyrillic_yu                 : Exit($44E);
    XK_Cyrillic_a                  : Exit($430);
    XK_Cyrillic_be                 : Exit($431);
    XK_Cyrillic_tse                : Exit($446);
    XK_Cyrillic_de                 : Exit($434);
    XK_Cyrillic_ie                 : Exit($435);
    XK_Cyrillic_ef                 : Exit($444);
    XK_Cyrillic_ghe                : Exit($433);
    XK_Cyrillic_ha                 : Exit($445);
    XK_Cyrillic_i                  : Exit($438);
    XK_Cyrillic_shorti             : Exit($439);
    XK_Cyrillic_ka                 : Exit($43A);
    XK_Cyrillic_el                 : Exit($43B);
    XK_Cyrillic_em                 : Exit($43C);
    XK_Cyrillic_en                 : Exit($43D);
    XK_Cyrillic_o                  : Exit($43E);
    XK_Cyrillic_pe                 : Exit($43F);
    XK_Cyrillic_ya                 : Exit($44F);
    XK_Cyrillic_er                 : Exit($440);
    XK_Cyrillic_es                 : Exit($441);
    XK_Cyrillic_te                 : Exit($442);
    XK_Cyrillic_u                  : Exit($443);
    XK_Cyrillic_zhe                : Exit($436);
    XK_Cyrillic_ve                 : Exit($432);
    XK_Cyrillic_softsign           : Exit($44C);
    XK_Cyrillic_yeru               : Exit($44B);
    XK_Cyrillic_ze                 : Exit($437);
    XK_Cyrillic_sha                : Exit($448);
    XK_Cyrillic_e                  : Exit($44D);
    XK_Cyrillic_shcha              : Exit($449);
    XK_Cyrillic_che                : Exit($447);
    XK_Cyrillic_hardsign           : Exit($44A);
    XKc_Cyrillic_YU                : Exit($42E);
    XKc_Cyrillic_A                 : Exit($410);
    XKc_Cyrillic_BE                : Exit($411);
    XKc_Cyrillic_TSE               : Exit($426);
    XKc_Cyrillic_DE                : Exit($414);
    XKc_Cyrillic_IE                : Exit($415);
    XKc_Cyrillic_EF                : Exit($424);
    XKc_Cyrillic_GHE               : Exit($413);
    XKc_Cyrillic_HA                : Exit($425);
    XKc_Cyrillic_I                 : Exit($418);
    XKc_Cyrillic_SHORTI            : Exit($419);
    XKc_Cyrillic_KA                : Exit($41A);
    XKc_Cyrillic_EL                : Exit($41B);
    XKc_Cyrillic_EM                : Exit($41C);
    XKc_Cyrillic_EN                : Exit($41D);
    XKc_Cyrillic_O                 : Exit($41E);
    XKc_Cyrillic_PE                : Exit($41F);
    XKc_Cyrillic_YA                : Exit($42F);
    XKc_Cyrillic_ER                : Exit($420);
    XKc_Cyrillic_ES                : Exit($421);
    XKc_Cyrillic_TE                : Exit($422);
    XKc_Cyrillic_U                 : Exit($423);
    XKc_Cyrillic_ZHE               : Exit($416);
    XKc_Cyrillic_VE                : Exit($412);
    XKc_Cyrillic_SOFTSIGN          : Exit($42C);
    XKc_Cyrillic_YERU              : Exit($42B);
    XKc_Cyrillic_ZE                : Exit($417);
    XKc_Cyrillic_SHA               : Exit($428);
    XKc_Cyrillic_E                 : Exit($42D);
    XKc_Cyrillic_SHCHA             : Exit($429);
    XKc_Cyrillic_CHE               : Exit($427);
    XKc_Cyrillic_HARDSIGN          : Exit($42A);

{    XKc_Greek_ALPHAaccent          : Exit($);
    XKc_Greek_EPSILONaccent        : Exit($);
    XKc_Greek_ETAaccent            : Exit($);
    XKc_Greek_IOTAaccent           : Exit($);
    XKc_Greek_IOTAdieresis         : Exit($);
    XKc_Greek_OMICRONaccent        : Exit($);
    XKc_Greek_UPSILONaccent        : Exit($);
    XKc_Greek_UPSILONdieresis      : Exit($);
    XKc_Greek_OMEGAaccent          : Exit($);
    XK_Greek_accentdieresis        : Exit($);
    XK_Greek_horizbar              : Exit($);
    XK_Greek_alphaaccent           : Exit($);
    XK_Greek_epsilonaccent         : Exit($);
    XK_Greek_etaaccent             : Exit($);
    XK_Greek_iotaaccent            : Exit($);
    XK_Greek_iotadieresis          : Exit($);
    XK_Greek_iotaaccentdieresis    : Exit($);
    XK_Greek_omicronaccent         : Exit($);
    XK_Greek_upsilonaccent         : Exit($);
    XK_Greek_upsilondieresis       : Exit($);
    XK_Greek_upsilonaccentdieresis : Exit($);
    XK_Greek_omegaaccent           : Exit($);}
    XKc_Greek_ALPHA                : Exit($391);
    XKc_Greek_BETA                 : Exit($392);
    XKc_Greek_GAMMA                : Exit($393);
    XKc_Greek_DELTA                : Exit($394);
    XKc_Greek_EPSILON              : Exit($395);
    XKc_Greek_ZETA                 : Exit($396);
    XKc_Greek_ETA                  : Exit($397);
    XKc_Greek_THETA                : Exit($398);
    XKc_Greek_IOTA                 : Exit($399);
    XKc_Greek_KAPPA                : Exit($39A);
    XKc_Greek_LAMDA                : Exit($39B);
    XKc_Greek_MU                   : Exit($39C);
    XKc_Greek_NU                   : Exit($39D);
    XKc_Greek_XI                   : Exit($39E);
    XKc_Greek_OMICRON              : Exit($39F);
    XKc_Greek_PI                   : Exit($3A0);
    XKc_Greek_RHO                  : Exit($3A1);
    XKc_Greek_SIGMA                : Exit($3A3);
    XKc_Greek_TAU                  : Exit($3A4);
    XKc_Greek_UPSILON              : Exit($3A5);
    XKc_Greek_PHI                  : Exit($3A6);
    XKc_Greek_CHI                  : Exit($3A7);
    XKc_Greek_PSI                  : Exit($3A8);
    XKc_Greek_OMEGA                : Exit($3A9);
    XK_Greek_alpha                 : Exit($3B1);
    XK_Greek_beta                  : Exit($3B2);
    XK_Greek_gamma                 : Exit($3B3);
    XK_Greek_delta                 : Exit($3B4);
    XK_Greek_epsilon               : Exit($3B5);
    XK_Greek_zeta                  : Exit($3B6);
    XK_Greek_eta                   : Exit($3B7);
    XK_Greek_theta                 : Exit($3B8);
    XK_Greek_iota                  : Exit($3B9);
    XK_Greek_kappa                 : Exit($3BA);
    XK_Greek_lamda                 : Exit($3BB);
    XK_Greek_mu                    : Exit($3BC);
    XK_Greek_nu                    : Exit($3BD);
    XK_Greek_xi                    : Exit($3BE);
    XK_Greek_omicron               : Exit($3BF);
    XK_Greek_pi                    : Exit($3C0);
    XK_Greek_rho                   : Exit($3C1);
    XK_Greek_sigma                 : Exit($3C2);
    XK_Greek_finalsmallsigma       : Exit($3C3);
    XK_Greek_tau                   : Exit($3C4);
    XK_Greek_upsilon               : Exit($3C5);
    XK_Greek_phi                   : Exit($3C6);
    XK_Greek_chi                   : Exit($3C7);
    XK_Greek_psi                   : Exit($3C8);
    XK_Greek_omega                 : Exit($3C9);

  End;
  X11ConvertKeySymToUnicode := -1;
End;
