#!/usr/bin/env python

import sys
import socket
import select
import Queue
import struct

keyNames = {
	0xffffff: "XK_VoidSymbol",
	0xff08: "XK_BackSpace",
	0xff09: "XK_Tab",
	0xff0a: "XK_Linefeed",
	0xff0b: "XK_Clear",
	0xff0d: "XK_Return",
	0xff13: "XK_Pause",
	0xff14: "XK_Scroll_Lock",
	0xff15: "XK_Sys_Req",
	0xff1b: "XK_Escape",
	0xffff: "XK_Delete",
	0xff20: "XK_Multi_key",
	0xff37: "XK_Codeinput",
	0xff3c: "XK_SingleCandidate",
	0xff3d: "XK_MultipleCandidate",
	0xff3e: "XK_PreviousCandidate",
	0xff21: "XK_Kanji",
	0xff22: "XK_Muhenkan",
	0xff23: "XK_Henkan_Mode",
	0xff23: "XK_Henkan",
	0xff24: "XK_Romaji",
	0xff25: "XK_Hiragana",
	0xff26: "XK_Katakana",
	0xff27: "XK_Hiragana_Katakana",
	0xff28: "XK_Zenkaku",
	0xff29: "XK_Hankaku",
	0xff2a: "XK_Zenkaku_Hankaku",
	0xff2b: "XK_Touroku",
	0xff2c: "XK_Massyo",
	0xff2d: "XK_Kana_Lock",
	0xff2e: "XK_Kana_Shift",
	0xff2f: "XK_Eisu_Shift",
	0xff30: "XK_Eisu_toggle",
	0xff37: "XK_Kanji_Bangou",
	0xff3d: "XK_Zen_Koho",
	0xff3e: "XK_Mae_Koho",
	0xff50: "XK_Home",
	0xff51: "XK_Left",
	0xff52: "XK_Up",
	0xff53: "XK_Right",
	0xff54: "XK_Down",
	0xff55: "XK_Prior",
	0xff55: "XK_Page_Up",
	0xff56: "XK_Next",
	0xff56: "XK_Page_Down",
	0xff57: "XK_End",
	0xff58: "XK_Begin",
	0xff60: "XK_Select",
	0xff61: "XK_Print",
	0xff62: "XK_Execute",
	0xff63: "XK_Insert",
	0xff65: "XK_Undo",
	0xff66: "XK_Redo",
	0xff67: "XK_Menu",
	0xff68: "XK_Find",
	0xff69: "XK_Cancel",
	0xff6a: "XK_Help",
	0xff6b: "XK_Break",
	0xff7e: "XK_Mode_switch",
	0xff7e: "XK_script_switch",
	0xff7f: "XK_Num_Lock",
	0xff80: "XK_KP_Space",
	0xff89: "XK_KP_Tab",
	0xff8d: "XK_KP_Enter",
	0xff91: "XK_KP_F1",
	0xff92: "XK_KP_F2",
	0xff93: "XK_KP_F3",
	0xff94: "XK_KP_F4",
	0xff95: "XK_KP_Home",
	0xff96: "XK_KP_Left",
	0xff97: "XK_KP_Up",
	0xff98: "XK_KP_Right",
	0xff99: "XK_KP_Down",
	0xff9a: "XK_KP_Prior",
	0xff9a: "XK_KP_Page_Up",
	0xff9b: "XK_KP_Next",
	0xff9b: "XK_KP_Page_Down",
	0xff9c: "XK_KP_End",
	0xff9d: "XK_KP_Begin",
	0xff9e: "XK_KP_Insert",
	0xff9f: "XK_KP_Delete",
	0xffbd: "XK_KP_Equal",
	0xffaa: "XK_KP_Multiply",
	0xffab: "XK_KP_Add",
	0xffac: "XK_KP_Separator",
	0xffad: "XK_KP_Subtract",
	0xffae: "XK_KP_Decimal",
	0xffaf: "XK_KP_Divide",
	0xffb0: "XK_KP_0",
	0xffb1: "XK_KP_1",
	0xffb2: "XK_KP_2",
	0xffb3: "XK_KP_3",
	0xffb4: "XK_KP_4",
	0xffb5: "XK_KP_5",
	0xffb6: "XK_KP_6",
	0xffb7: "XK_KP_7",
	0xffb8: "XK_KP_8",
	0xffb9: "XK_KP_9",
	0xffbe: "XK_F1",
	0xffbf: "XK_F2",
	0xffc0: "XK_F3",
	0xffc1: "XK_F4",
	0xffc2: "XK_F5",
	0xffc3: "XK_F6",
	0xffc4: "XK_F7",
	0xffc5: "XK_F8",
	0xffc6: "XK_F9",
	0xffc7: "XK_F10",
	0xffc8: "XK_F11",
	0xffc8: "XK_L1",
	0xffc9: "XK_F12",
	0xffc9: "XK_L2",
	0xffca: "XK_F13",
	0xffca: "XK_L3",
	0xffcb: "XK_F14",
	0xffcb: "XK_L4",
	0xffcc: "XK_F15",
	0xffcc: "XK_L5",
	0xffcd: "XK_F16",
	0xffcd: "XK_L6",
	0xffce: "XK_F17",
	0xffce: "XK_L7",
	0xffcf: "XK_F18",
	0xffcf: "XK_L8",
	0xffd0: "XK_F19",
	0xffd0: "XK_L9",
	0xffd1: "XK_F20",
	0xffd1: "XK_L10",
	0xffd2: "XK_F21",
	0xffd2: "XK_R1",
	0xffd3: "XK_F22",
	0xffd3: "XK_R2",
	0xffd4: "XK_F23",
	0xffd4: "XK_R3",
	0xffd5: "XK_F24",
	0xffd5: "XK_R4",
	0xffd6: "XK_F25",
	0xffd6: "XK_R5",
	0xffd7: "XK_F26",
	0xffd7: "XK_R6",
	0xffd8: "XK_F27",
	0xffd8: "XK_R7",
	0xffd9: "XK_F28",
	0xffd9: "XK_R8",
	0xffda: "XK_F29",
	0xffda: "XK_R9",
	0xffdb: "XK_F30",
	0xffdb: "XK_R10",
	0xffdc: "XK_F31",
	0xffdc: "XK_R11",
	0xffdd: "XK_F32",
	0xffdd: "XK_R12",
	0xffde: "XK_F33",
	0xffde: "XK_R13",
	0xffdf: "XK_F34",
	0xffdf: "XK_R14",
	0xffe0: "XK_F35",
	0xffe0: "XK_R15",
	0xffe1: "XK_Shift_L",
	0xffe2: "XK_Shift_R",
	0xffe3: "XK_Control_L",
	0xffe4: "XK_Control_R",
	0xffe5: "XK_Caps_Lock",
	0xffe6: "XK_Shift_Lock",
	0xffe7: "XK_Meta_L",
	0xffe8: "XK_Meta_R",
	0xffe9: "XK_Alt_L",
	0xffea: "XK_Alt_R",
	0xffeb: "XK_Super_L",
	0xffec: "XK_Super_R",
	0xffed: "XK_Hyper_L",
	0xffee: "XK_Hyper_R",
	0xfe01: "XK_ISO_Lock",
	0xfe02: "XK_ISO_Level2_Latch",
	0xfe03: "XK_ISO_Level3_Shift",
	0xfe04: "XK_ISO_Level3_Latch",
	0xfe05: "XK_ISO_Level3_Lock",
	0xff7e: "XK_ISO_Group_Shift",
	0xfe06: "XK_ISO_Group_Latch",
	0xfe07: "XK_ISO_Group_Lock",
	0xfe08: "XK_ISO_Next_Group",
	0xfe09: "XK_ISO_Next_Group_Lock",
	0xfe0a: "XK_ISO_Prev_Group",
	0xfe0b: "XK_ISO_Prev_Group_Lock",
	0xfe0c: "XK_ISO_First_Group",
	0xfe0d: "XK_ISO_First_Group_Lock",
	0xfe0e: "XK_ISO_Last_Group",
	0xfe0f: "XK_ISO_Last_Group_Lock",
	0xfe20: "XK_ISO_Left_Tab",
	0xfe21: "XK_ISO_Move_Line_Up",
	0xfe22: "XK_ISO_Move_Line_Down",
	0xfe23: "XK_ISO_Partial_Line_Up",
	0xfe24: "XK_ISO_Partial_Line_Down",
	0xfe25: "XK_ISO_Partial_Space_Left",
	0xfe26: "XK_ISO_Partial_Space_Right",
	0xfe27: "XK_ISO_Set_Margin_Left",
	0xfe28: "XK_ISO_Set_Margin_Right",
	0xfe29: "XK_ISO_Release_Margin_Left",
	0xfe2a: "XK_ISO_Release_Margin_Right",
	0xfe2b: "XK_ISO_Release_Both_Margins",
	0xfe2c: "XK_ISO_Fast_Cursor_Left",
	0xfe2d: "XK_ISO_Fast_Cursor_Right",
	0xfe2e: "XK_ISO_Fast_Cursor_Up",
	0xfe2f: "XK_ISO_Fast_Cursor_Down",
	0xfe30: "XK_ISO_Continuous_Underline",
	0xfe31: "XK_ISO_Discontinuous_Underline",
	0xfe32: "XK_ISO_Emphasize",
	0xfe33: "XK_ISO_Center_Object",
	0xfe34: "XK_ISO_Enter",
	0xfe50: "XK_dead_grave",
	0xfe51: "XK_dead_acute",
	0xfe52: "XK_dead_circumflex",
	0xfe53: "XK_dead_tilde",
	0xfe54: "XK_dead_macron",
	0xfe55: "XK_dead_breve",
	0xfe56: "XK_dead_abovedot",
	0xfe57: "XK_dead_diaeresis",
	0xfe58: "XK_dead_abovering",
	0xfe59: "XK_dead_doubleacute",
	0xfe5a: "XK_dead_caron",
	0xfe5b: "XK_dead_cedilla",
	0xfe5c: "XK_dead_ogonek",
	0xfe5d: "XK_dead_iota",
	0xfe5e: "XK_dead_voiced_sound",
	0xfe5f: "XK_dead_semivoiced_sound",
	0xfe60: "XK_dead_belowdot",
	0xfe61: "XK_dead_hook",
	0xfe62: "XK_dead_horn",
	0xfed0: "XK_First_Virtual_Screen",
	0xfed1: "XK_Prev_Virtual_Screen",
	0xfed2: "XK_Next_Virtual_Screen",
	0xfed4: "XK_Last_Virtual_Screen",
	0xfed5: "XK_Terminate_Server",
	0xfe70: "XK_AccessX_Enable",
	0xfe71: "XK_AccessX_Feedback_Enable",
	0xfe72: "XK_RepeatKeys_Enable",
	0xfe73: "XK_SlowKeys_Enable",
	0xfe74: "XK_BounceKeys_Enable",
	0xfe75: "XK_StickyKeys_Enable",
	0xfe76: "XK_MouseKeys_Enable",
	0xfe77: "XK_MouseKeys_Accel_Enable",
	0xfe78: "XK_Overlay1_Enable",
	0xfe79: "XK_Overlay2_Enable",
	0xfe7a: "XK_AudibleBell_Enable",
	0xfee0: "XK_Pointer_Left",
	0xfee1: "XK_Pointer_Right",
	0xfee2: "XK_Pointer_Up",
	0xfee3: "XK_Pointer_Down",
	0xfee4: "XK_Pointer_UpLeft",
	0xfee5: "XK_Pointer_UpRight",
	0xfee6: "XK_Pointer_DownLeft",
	0xfee7: "XK_Pointer_DownRight",
	0xfee8: "XK_Pointer_Button_Dflt",
	0xfee9: "XK_Pointer_Button1",
	0xfeea: "XK_Pointer_Button2",
	0xfeeb: "XK_Pointer_Button3",
	0xfeec: "XK_Pointer_Button4",
	0xfeed: "XK_Pointer_Button5",
	0xfeee: "XK_Pointer_DblClick_Dflt",
	0xfeef: "XK_Pointer_DblClick1",
	0xfef0: "XK_Pointer_DblClick2",
	0xfef1: "XK_Pointer_DblClick3",
	0xfef2: "XK_Pointer_DblClick4",
	0xfef3: "XK_Pointer_DblClick5",
	0xfef4: "XK_Pointer_Drag_Dflt",
	0xfef5: "XK_Pointer_Drag1",
	0xfef6: "XK_Pointer_Drag2",
	0xfef7: "XK_Pointer_Drag3",
	0xfef8: "XK_Pointer_Drag4",
	0xfefd: "XK_Pointer_Drag5",
	0xfef9: "XK_Pointer_EnableKeys",
	0xfefa: "XK_Pointer_Accelerate",
	0xfefb: "XK_Pointer_DfltBtnNext",
	0xfefc: "XK_Pointer_DfltBtnPrev",
	0xfd01: "XK_3270_Duplicate",
	0xfd02: "XK_3270_FieldMark",
	0xfd03: "XK_3270_Right2",
	0xfd04: "XK_3270_Left2",
	0xfd05: "XK_3270_BackTab",
	0xfd06: "XK_3270_EraseEOF",
	0xfd07: "XK_3270_EraseInput",
	0xfd08: "XK_3270_Reset",
	0xfd09: "XK_3270_Quit",
	0xfd0a: "XK_3270_PA1",
	0xfd0b: "XK_3270_PA2",
	0xfd0c: "XK_3270_PA3",
	0xfd0d: "XK_3270_Test",
	0xfd0e: "XK_3270_Attn",
	0xfd0f: "XK_3270_CursorBlink",
	0xfd10: "XK_3270_AltCursor",
	0xfd11: "XK_3270_KeyClick",
	0xfd12: "XK_3270_Jump",
	0xfd13: "XK_3270_Ident",
	0xfd14: "XK_3270_Rule",
	0xfd15: "XK_3270_Copy",
	0xfd16: "XK_3270_Play",
	0xfd17: "XK_3270_Setup",
	0xfd18: "XK_3270_Record",
	0xfd19: "XK_3270_ChangeScreen",
	0xfd1a: "XK_3270_DeleteWord",
	0xfd1b: "XK_3270_ExSelect",
	0xfd1c: "XK_3270_CursorSelect",
	0xfd1d: "XK_3270_PrintScreen",
	0xfd1e: "XK_3270_Enter",
	0x0020: "XK_space",
	0x0021: "XK_exclam",
	0x0022: "XK_quotedbl",
	0x0023: "XK_numbersign",
	0x0024: "XK_dollar",
	0x0025: "XK_percent",
	0x0026: "XK_ampersand",
	0x0027: "XK_apostrophe",
	0x0027: "XK_quoteright",
	0x0028: "XK_parenleft",
	0x0029: "XK_parenright",
	0x002a: "XK_asterisk",
	0x002b: "XK_plus",
	0x002c: "XK_comma",
	0x002d: "XK_minus",
	0x002e: "XK_period",
	0x002f: "XK_slash",
	0x0030: "XK_0",
	0x0031: "XK_1",
	0x0032: "XK_2",
	0x0033: "XK_3",
	0x0034: "XK_4",
	0x0035: "XK_5",
	0x0036: "XK_6",
	0x0037: "XK_7",
	0x0038: "XK_8",
	0x0039: "XK_9",
	0x003a: "XK_colon",
	0x003b: "XK_semicolon",
	0x003c: "XK_less",
	0x003d: "XK_equal",
	0x003e: "XK_greater",
	0x003f: "XK_question",
	0x0040: "XK_at",
	0x0041: "XK_A",
	0x0042: "XK_B",
	0x0043: "XK_C",
	0x0044: "XK_D",
	0x0045: "XK_E",
	0x0046: "XK_F",
	0x0047: "XK_G",
	0x0048: "XK_H",
	0x0049: "XK_I",
	0x004a: "XK_J",
	0x004b: "XK_K",
	0x004c: "XK_L",
	0x004d: "XK_M",
	0x004e: "XK_N",
	0x004f: "XK_O",
	0x0050: "XK_P",
	0x0051: "XK_Q",
	0x0052: "XK_R",
	0x0053: "XK_S",
	0x0054: "XK_T",
	0x0055: "XK_U",
	0x0056: "XK_V",
	0x0057: "XK_W",
	0x0058: "XK_X",
	0x0059: "XK_Y",
	0x005a: "XK_Z",
	0x005b: "XK_bracketleft",
	0x005c: "XK_backslash",
	0x005d: "XK_bracketright",
	0x005e: "XK_asciicircum",
	0x005f: "XK_underscore",
	0x0060: "XK_grave",
	0x0060: "XK_quoteleft",
	0x0061: "XK_a",
	0x0062: "XK_b",
	0x0063: "XK_c",
	0x0064: "XK_d",
	0x0065: "XK_e",
	0x0066: "XK_f",
	0x0067: "XK_g",
	0x0068: "XK_h",
	0x0069: "XK_i",
	0x006a: "XK_j",
	0x006b: "XK_k",
	0x006c: "XK_l",
	0x006d: "XK_m",
	0x006e: "XK_n",
	0x006f: "XK_o",
	0x0070: "XK_p",
	0x0071: "XK_q",
	0x0072: "XK_r",
	0x0073: "XK_s",
	0x0074: "XK_t",
	0x0075: "XK_u",
	0x0076: "XK_v",
	0x0077: "XK_w",
	0x0078: "XK_x",
	0x0079: "XK_y",
	0x007a: "XK_z",
	0x007b: "XK_braceleft",
	0x007c: "XK_bar",
	0x007d: "XK_braceright",
	0x007e: "XK_asciitilde",
	0x00a0: "XK_nobreakspace",
	0x00a1: "XK_exclamdown",
	0x00a2: "XK_cent",
	0x00a3: "XK_sterling",
	0x00a4: "XK_currency",
	0x00a5: "XK_yen",
	0x00a6: "XK_brokenbar",
	0x00a7: "XK_section",
	0x00a8: "XK_diaeresis",
	0x00a9: "XK_copyright",
	0x00aa: "XK_ordfeminine",
	0x00ab: "XK_guillemotleft",
	0x00ac: "XK_notsign",
	0x00ad: "XK_hyphen",
	0x00ae: "XK_registered",
	0x00af: "XK_macron",
	0x00b0: "XK_degree",
	0x00b1: "XK_plusminus",
	0x00b2: "XK_twosuperior",
	0x00b3: "XK_threesuperior",
	0x00b4: "XK_acute",
	0x00b5: "XK_mu",
	0x00b6: "XK_paragraph",
	0x00b7: "XK_periodcentered",
	0x00b8: "XK_cedilla",
	0x00b9: "XK_onesuperior",
	0x00ba: "XK_masculine",
	0x00bb: "XK_guillemotright",
	0x00bc: "XK_onequarter",
	0x00bd: "XK_onehalf",
	0x00be: "XK_threequarters",
	0x00bf: "XK_questiondown",
	0x00c0: "XK_Agrave",
	0x00c1: "XK_Aacute",
	0x00c2: "XK_Acircumflex",
	0x00c3: "XK_Atilde",
	0x00c4: "XK_Adiaeresis",
	0x00c5: "XK_Aring",
	0x00c6: "XK_AE",
	0x00c7: "XK_Ccedilla",
	0x00c8: "XK_Egrave",
	0x00c9: "XK_Eacute",
	0x00ca: "XK_Ecircumflex",
	0x00cb: "XK_Ediaeresis",
	0x00cc: "XK_Igrave",
	0x00cd: "XK_Iacute",
	0x00ce: "XK_Icircumflex",
	0x00cf: "XK_Idiaeresis",
	0x00d0: "XK_ETH",
	0x00d0: "XK_Eth",
	0x00d1: "XK_Ntilde",
	0x00d2: "XK_Ograve",
	0x00d3: "XK_Oacute",
	0x00d4: "XK_Ocircumflex",
	0x00d5: "XK_Otilde",
	0x00d6: "XK_Odiaeresis",
	0x00d7: "XK_multiply",
	0x00d8: "XK_Oslash",
	0x00d8: "XK_Ooblique",
	0x00d9: "XK_Ugrave",
	0x00da: "XK_Uacute",
	0x00db: "XK_Ucircumflex",
	0x00dc: "XK_Udiaeresis",
	0x00dd: "XK_Yacute",
	0x00de: "XK_THORN",
	0x00de: "XK_Thorn",
	0x00df: "XK_ssharp",
	0x00e0: "XK_agrave",
	0x00e1: "XK_aacute",
	0x00e2: "XK_acircumflex",
	0x00e3: "XK_atilde",
	0x00e4: "XK_adiaeresis",
	0x00e5: "XK_aring",
	0x00e6: "XK_ae",
	0x00e7: "XK_ccedilla",
	0x00e8: "XK_egrave",
	0x00e9: "XK_eacute",
	0x00ea: "XK_ecircumflex",
	0x00eb: "XK_ediaeresis",
	0x00ec: "XK_igrave",
	0x00ed: "XK_iacute",
	0x00ee: "XK_icircumflex",
	0x00ef: "XK_idiaeresis",
	0x00f0: "XK_eth",
	0x00f1: "XK_ntilde",
	0x00f2: "XK_ograve",
	0x00f3: "XK_oacute",
	0x00f4: "XK_ocircumflex",
	0x00f5: "XK_otilde",
	0x00f6: "XK_odiaeresis",
	0x00f7: "XK_division",
	0x00f8: "XK_oslash",
	0x00f8: "XK_ooblique",
	0x00f9: "XK_ugrave",
	0x00fa: "XK_uacute",
	0x00fb: "XK_ucircumflex",
	0x00fc: "XK_udiaeresis",
	0x00fd: "XK_yacute",
	0x00fe: "XK_thorn",
	0x00ff: "XK_ydiaeresis",
	0x01a1: "XK_Aogonek",
	0x01a2: "XK_breve",
	0x01a3: "XK_Lstroke",
	0x01a5: "XK_Lcaron",
	0x01a6: "XK_Sacute",
	0x01a9: "XK_Scaron",
	0x01aa: "XK_Scedilla",
	0x01ab: "XK_Tcaron",
	0x01ac: "XK_Zacute",
	0x01ae: "XK_Zcaron",
	0x01af: "XK_Zabovedot",
	0x01b1: "XK_aogonek",
	0x01b2: "XK_ogonek",
	0x01b3: "XK_lstroke",
	0x01b5: "XK_lcaron",
	0x01b6: "XK_sacute",
	0x01b7: "XK_caron",
	0x01b9: "XK_scaron",
	0x01ba: "XK_scedilla",
	0x01bb: "XK_tcaron",
	0x01bc: "XK_zacute",
	0x01bd: "XK_doubleacute",
	0x01be: "XK_zcaron",
	0x01bf: "XK_zabovedot",
	0x01c0: "XK_Racute",
	0x01c3: "XK_Abreve",
	0x01c5: "XK_Lacute",
	0x01c6: "XK_Cacute",
	0x01c8: "XK_Ccaron",
	0x01ca: "XK_Eogonek",
	0x01cc: "XK_Ecaron",
	0x01cf: "XK_Dcaron",
	0x01d0: "XK_Dstroke",
	0x01d1: "XK_Nacute",
	0x01d2: "XK_Ncaron",
	0x01d5: "XK_Odoubleacute",
	0x01d8: "XK_Rcaron",
	0x01d9: "XK_Uring",
	0x01db: "XK_Udoubleacute",
	0x01de: "XK_Tcedilla",
	0x01e0: "XK_racute",
	0x01e3: "XK_abreve",
	0x01e5: "XK_lacute",
	0x01e6: "XK_cacute",
	0x01e8: "XK_ccaron",
	0x01ea: "XK_eogonek",
	0x01ec: "XK_ecaron",
	0x01ef: "XK_dcaron",
	0x01f0: "XK_dstroke",
	0x01f1: "XK_nacute",
	0x01f2: "XK_ncaron",
	0x01f5: "XK_odoubleacute",
	0x01fb: "XK_udoubleacute",
	0x01f8: "XK_rcaron",
	0x01f9: "XK_uring",
	0x01fe: "XK_tcedilla",
	0x01ff: "XK_abovedot",
	0x02a1: "XK_Hstroke",
	0x02a6: "XK_Hcircumflex",
	0x02a9: "XK_Iabovedot",
	0x02ab: "XK_Gbreve",
	0x02ac: "XK_Jcircumflex",
	0x02b1: "XK_hstroke",
	0x02b6: "XK_hcircumflex",
	0x02b9: "XK_idotless",
	0x02bb: "XK_gbreve",
	0x02bc: "XK_jcircumflex",
	0x02c5: "XK_Cabovedot",
	0x02c6: "XK_Ccircumflex",
	0x02d5: "XK_Gabovedot",
	0x02d8: "XK_Gcircumflex",
	0x02dd: "XK_Ubreve",
	0x02de: "XK_Scircumflex",
	0x02e5: "XK_cabovedot",
	0x02e6: "XK_ccircumflex",
	0x02f5: "XK_gabovedot",
	0x02f8: "XK_gcircumflex",
	0x02fd: "XK_ubreve",
	0x02fe: "XK_scircumflex",
	0x03a2: "XK_kra",
	0x03a2: "XK_kappa",
	0x03a3: "XK_Rcedilla",
	0x03a5: "XK_Itilde",
	0x03a6: "XK_Lcedilla",
	0x03aa: "XK_Emacron",
	0x03ab: "XK_Gcedilla",
	0x03ac: "XK_Tslash",
	0x03b3: "XK_rcedilla",
	0x03b5: "XK_itilde",
	0x03b6: "XK_lcedilla",
	0x03ba: "XK_emacron",
	0x03bb: "XK_gcedilla",
	0x03bc: "XK_tslash",
	0x03bd: "XK_ENG",
	0x03bf: "XK_eng",
	0x03c0: "XK_Amacron",
	0x03c7: "XK_Iogonek",
	0x03cc: "XK_Eabovedot",
	0x03cf: "XK_Imacron",
	0x03d1: "XK_Ncedilla",
	0x03d2: "XK_Omacron",
	0x03d3: "XK_Kcedilla",
	0x03d9: "XK_Uogonek",
	0x03dd: "XK_Utilde",
	0x03de: "XK_Umacron",
	0x03e0: "XK_amacron",
	0x03e7: "XK_iogonek",
	0x03ec: "XK_eabovedot",
	0x03ef: "XK_imacron",
	0x03f1: "XK_ncedilla",
	0x03f2: "XK_omacron",
	0x03f3: "XK_kcedilla",
	0x03f9: "XK_uogonek",
	0x03fd: "XK_utilde",
	0x03fe: "XK_umacron",
	0x1001e02: "XK_Babovedot",
	0x1001e03: "XK_babovedot",
	0x1001e0a: "XK_Dabovedot",
	0x1001e80: "XK_Wgrave",
	0x1001e82: "XK_Wacute",
	0x1001e0b: "XK_dabovedot",
	0x1001ef2: "XK_Ygrave",
	0x1001e1e: "XK_Fabovedot",
	0x1001e1f: "XK_fabovedot",
	0x1001e40: "XK_Mabovedot",
	0x1001e41: "XK_mabovedot",
	0x1001e56: "XK_Pabovedot",
	0x1001e81: "XK_wgrave",
	0x1001e57: "XK_pabovedot",
	0x1001e83: "XK_wacute",
	0x1001e60: "XK_Sabovedot",
	0x1001ef3: "XK_ygrave",
	0x1001e84: "XK_Wdiaeresis",
	0x1001e85: "XK_wdiaeresis",
	0x1001e61: "XK_sabovedot",
	0x1000174: "XK_Wcircumflex",
	0x1001e6a: "XK_Tabovedot",
	0x1000176: "XK_Ycircumflex",
	0x1000175: "XK_wcircumflex",
	0x1001e6b: "XK_tabovedot",
	0x1000177: "XK_ycircumflex",
	0x13bc: "XK_OE",
	0x13bd: "XK_oe",
	0x13be: "XK_Ydiaeresis",
	0x047e: "XK_overline",
	0x04a1: "XK_kana_fullstop",
	0x04a2: "XK_kana_openingbracket",
	0x04a3: "XK_kana_closingbracket",
	0x04a4: "XK_kana_comma",
	0x04a5: "XK_kana_conjunctive",
	0x04a5: "XK_kana_middledot",
	0x04a6: "XK_kana_WO",
	0x04a7: "XK_kana_a",
	0x04a8: "XK_kana_i",
	0x04a9: "XK_kana_u",
	0x04aa: "XK_kana_e",
	0x04ab: "XK_kana_o",
	0x04ac: "XK_kana_ya",
	0x04ad: "XK_kana_yu",
	0x04ae: "XK_kana_yo",
	0x04af: "XK_kana_tsu",
	0x04af: "XK_kana_tu",
	0x04b0: "XK_prolongedsound",
	0x04b1: "XK_kana_A",
	0x04b2: "XK_kana_I",
	0x04b3: "XK_kana_U",
	0x04b4: "XK_kana_E",
	0x04b5: "XK_kana_O",
	0x04b6: "XK_kana_KA",
	0x04b7: "XK_kana_KI",
	0x04b8: "XK_kana_KU",
	0x04b9: "XK_kana_KE",
	0x04ba: "XK_kana_KO",
	0x04bb: "XK_kana_SA",
	0x04bc: "XK_kana_SHI",
	0x04bd: "XK_kana_SU",
	0x04be: "XK_kana_SE",
	0x04bf: "XK_kana_SO",
	0x04c0: "XK_kana_TA",
	0x04c1: "XK_kana_CHI",
	0x04c1: "XK_kana_TI",
	0x04c2: "XK_kana_TSU",
	0x04c2: "XK_kana_TU",
	0x04c3: "XK_kana_TE",
	0x04c4: "XK_kana_TO",
	0x04c5: "XK_kana_NA",
	0x04c6: "XK_kana_NI",
	0x04c7: "XK_kana_NU",
	0x04c8: "XK_kana_NE",
	0x04c9: "XK_kana_NO",
	0x04ca: "XK_kana_HA",
	0x04cb: "XK_kana_HI",
	0x04cc: "XK_kana_FU",
	0x04cc: "XK_kana_HU",
	0x04cd: "XK_kana_HE",
	0x04ce: "XK_kana_HO",
	0x04cf: "XK_kana_MA",
	0x04d0: "XK_kana_MI",
	0x04d1: "XK_kana_MU",
	0x04d2: "XK_kana_ME",
	0x04d3: "XK_kana_MO",
	0x04d4: "XK_kana_YA",
	0x04d5: "XK_kana_YU",
	0x04d6: "XK_kana_YO",
	0x04d7: "XK_kana_RA",
	0x04d8: "XK_kana_RI",
	0x04d9: "XK_kana_RU",
	0x04da: "XK_kana_RE",
	0x04db: "XK_kana_RO",
	0x04dc: "XK_kana_WA",
	0x04dd: "XK_kana_N",
	0x04de: "XK_voicedsound",
	0x04df: "XK_semivoicedsound",
	0xff7e: "XK_kana_switch",
	0x10006f0: "XK_Farsi_0",
	0x10006f1: "XK_Farsi_1",
	0x10006f2: "XK_Farsi_2",
	0x10006f3: "XK_Farsi_3",
	0x10006f4: "XK_Farsi_4",
	0x10006f5: "XK_Farsi_5",
	0x10006f6: "XK_Farsi_6",
	0x10006f7: "XK_Farsi_7",
	0x10006f8: "XK_Farsi_8",
	0x10006f9: "XK_Farsi_9",
	0x100066a: "XK_Arabic_percent",
	0x1000670: "XK_Arabic_superscript_alef",
	0x1000679: "XK_Arabic_tteh",
	0x100067e: "XK_Arabic_peh",
	0x1000686: "XK_Arabic_tcheh",
	0x1000688: "XK_Arabic_ddal",
	0x1000691: "XK_Arabic_rreh",
	0x05ac: "XK_Arabic_comma",
	0x10006d4: "XK_Arabic_fullstop",
	0x1000660: "XK_Arabic_0",
	0x1000661: "XK_Arabic_1",
	0x1000662: "XK_Arabic_2",
	0x1000663: "XK_Arabic_3",
	0x1000664: "XK_Arabic_4",
	0x1000665: "XK_Arabic_5",
	0x1000666: "XK_Arabic_6",
	0x1000667: "XK_Arabic_7",
	0x1000668: "XK_Arabic_8",
	0x1000669: "XK_Arabic_9",
	0x05bb: "XK_Arabic_semicolon",
	0x05bf: "XK_Arabic_question_mark",
	0x05c1: "XK_Arabic_hamza",
	0x05c2: "XK_Arabic_maddaonalef",
	0x05c3: "XK_Arabic_hamzaonalef",
	0x05c4: "XK_Arabic_hamzaonwaw",
	0x05c5: "XK_Arabic_hamzaunderalef",
	0x05c6: "XK_Arabic_hamzaonyeh",
	0x05c7: "XK_Arabic_alef",
	0x05c8: "XK_Arabic_beh",
	0x05c9: "XK_Arabic_tehmarbuta",
	0x05ca: "XK_Arabic_teh",
	0x05cb: "XK_Arabic_theh",
	0x05cc: "XK_Arabic_jeem",
	0x05cd: "XK_Arabic_hah",
	0x05ce: "XK_Arabic_khah",
	0x05cf: "XK_Arabic_dal",
	0x05d0: "XK_Arabic_thal",
	0x05d1: "XK_Arabic_ra",
	0x05d2: "XK_Arabic_zain",
	0x05d3: "XK_Arabic_seen",
	0x05d4: "XK_Arabic_sheen",
	0x05d5: "XK_Arabic_sad",
	0x05d6: "XK_Arabic_dad",
	0x05d7: "XK_Arabic_tah",
	0x05d8: "XK_Arabic_zah",
	0x05d9: "XK_Arabic_ain",
	0x05da: "XK_Arabic_ghain",
	0x05e0: "XK_Arabic_tatweel",
	0x05e1: "XK_Arabic_feh",
	0x05e2: "XK_Arabic_qaf",
	0x05e3: "XK_Arabic_kaf",
	0x05e4: "XK_Arabic_lam",
	0x05e5: "XK_Arabic_meem",
	0x05e6: "XK_Arabic_noon",
	0x05e7: "XK_Arabic_ha",
	0x05e7: "XK_Arabic_heh",
	0x05e8: "XK_Arabic_waw",
	0x05e9: "XK_Arabic_alefmaksura",
	0x05ea: "XK_Arabic_yeh",
	0x05eb: "XK_Arabic_fathatan",
	0x05ec: "XK_Arabic_dammatan",
	0x05ed: "XK_Arabic_kasratan",
	0x05ee: "XK_Arabic_fatha",
	0x05ef: "XK_Arabic_damma",
	0x05f0: "XK_Arabic_kasra",
	0x05f1: "XK_Arabic_shadda",
	0x05f2: "XK_Arabic_sukun",
	0x1000653: "XK_Arabic_madda_above",
	0x1000654: "XK_Arabic_hamza_above",
	0x1000655: "XK_Arabic_hamza_below",
	0x1000698: "XK_Arabic_jeh",
	0x10006a4: "XK_Arabic_veh",
	0x10006a9: "XK_Arabic_keheh",
	0x10006af: "XK_Arabic_gaf",
	0x10006ba: "XK_Arabic_noon_ghunna",
	0x10006be: "XK_Arabic_heh_doachashmee",
	0x10006cc: "XK_Farsi_yeh",
	0x10006cc: "XK_Arabic_farsi_yeh",
	0x10006d2: "XK_Arabic_yeh_baree",
	0x10006c1: "XK_Arabic_heh_goal",
	0xff7e: "XK_Arabic_switch",
	0x1000492: "XK_Cyrillic_GHE_bar",
	0x1000493: "XK_Cyrillic_ghe_bar",
	0x1000496: "XK_Cyrillic_ZHE_descender",
	0x1000497: "XK_Cyrillic_zhe_descender",
	0x100049a: "XK_Cyrillic_KA_descender",
	0x100049b: "XK_Cyrillic_ka_descender",
	0x100049c: "XK_Cyrillic_KA_vertstroke",
	0x100049d: "XK_Cyrillic_ka_vertstroke",
	0x10004a2: "XK_Cyrillic_EN_descender",
	0x10004a3: "XK_Cyrillic_en_descender",
	0x10004ae: "XK_Cyrillic_U_straight",
	0x10004af: "XK_Cyrillic_u_straight",
	0x10004b0: "XK_Cyrillic_U_straight_bar",
	0x10004b1: "XK_Cyrillic_u_straight_bar",
	0x10004b2: "XK_Cyrillic_HA_descender",
	0x10004b3: "XK_Cyrillic_ha_descender",
	0x10004b6: "XK_Cyrillic_CHE_descender",
	0x10004b7: "XK_Cyrillic_che_descender",
	0x10004b8: "XK_Cyrillic_CHE_vertstroke",
	0x10004b9: "XK_Cyrillic_che_vertstroke",
	0x10004ba: "XK_Cyrillic_SHHA",
	0x10004bb: "XK_Cyrillic_shha",
	0x10004d8: "XK_Cyrillic_SCHWA",
	0x10004d9: "XK_Cyrillic_schwa",
	0x10004e2: "XK_Cyrillic_I_macron",
	0x10004e3: "XK_Cyrillic_i_macron",
	0x10004e8: "XK_Cyrillic_O_bar",
	0x10004e9: "XK_Cyrillic_o_bar",
	0x10004ee: "XK_Cyrillic_U_macron",
	0x10004ef: "XK_Cyrillic_u_macron",
	0x06a1: "XK_Serbian_dje",
	0x06a2: "XK_Macedonia_gje",
	0x06a3: "XK_Cyrillic_io",
	0x06a4: "XK_Ukrainian_ie",
	0x06a4: "XK_Ukranian_je",
	0x06a5: "XK_Macedonia_dse",
	0x06a6: "XK_Ukrainian_i",
	0x06a6: "XK_Ukranian_i",
	0x06a7: "XK_Ukrainian_yi",
	0x06a7: "XK_Ukranian_yi",
	0x06a8: "XK_Cyrillic_je",
	0x06a8: "XK_Serbian_je",
	0x06a9: "XK_Cyrillic_lje",
	0x06a9: "XK_Serbian_lje",
	0x06aa: "XK_Cyrillic_nje",
	0x06aa: "XK_Serbian_nje",
	0x06ab: "XK_Serbian_tshe",
	0x06ac: "XK_Macedonia_kje",
	0x06ad: "XK_Ukrainian_ghe_with_upturn",
	0x06ae: "XK_Byelorussian_shortu",
	0x06af: "XK_Cyrillic_dzhe",
	0x06af: "XK_Serbian_dze",
	0x06b0: "XK_numerosign",
	0x06b1: "XK_Serbian_DJE",
	0x06b2: "XK_Macedonia_GJE",
	0x06b3: "XK_Cyrillic_IO",
	0x06b4: "XK_Ukrainian_IE",
	0x06b4: "XK_Ukranian_JE",
	0x06b5: "XK_Macedonia_DSE",
	0x06b6: "XK_Ukrainian_I",
	0x06b6: "XK_Ukranian_I",
	0x06b7: "XK_Ukrainian_YI",
	0x06b7: "XK_Ukranian_YI",
	0x06b8: "XK_Cyrillic_JE",
	0x06b8: "XK_Serbian_JE",
	0x06b9: "XK_Cyrillic_LJE",
	0x06b9: "XK_Serbian_LJE",
	0x06ba: "XK_Cyrillic_NJE",
	0x06ba: "XK_Serbian_NJE",
	0x06bb: "XK_Serbian_TSHE",
	0x06bc: "XK_Macedonia_KJE",
	0x06bd: "XK_Ukrainian_GHE_WITH_UPTURN",
	0x06be: "XK_Byelorussian_SHORTU",
	0x06bf: "XK_Cyrillic_DZHE",
	0x06bf: "XK_Serbian_DZE",
	0x06c0: "XK_Cyrillic_yu",
	0x06c1: "XK_Cyrillic_a",
	0x06c2: "XK_Cyrillic_be",
	0x06c3: "XK_Cyrillic_tse",
	0x06c4: "XK_Cyrillic_de",
	0x06c5: "XK_Cyrillic_ie",
	0x06c6: "XK_Cyrillic_ef",
	0x06c7: "XK_Cyrillic_ghe",
	0x06c8: "XK_Cyrillic_ha",
	0x06c9: "XK_Cyrillic_i",
	0x06ca: "XK_Cyrillic_shorti",
	0x06cb: "XK_Cyrillic_ka",
	0x06cc: "XK_Cyrillic_el",
	0x06cd: "XK_Cyrillic_em",
	0x06ce: "XK_Cyrillic_en",
	0x06cf: "XK_Cyrillic_o",
	0x06d0: "XK_Cyrillic_pe",
	0x06d1: "XK_Cyrillic_ya",
	0x06d2: "XK_Cyrillic_er",
	0x06d3: "XK_Cyrillic_es",
	0x06d4: "XK_Cyrillic_te",
	0x06d5: "XK_Cyrillic_u",
	0x06d6: "XK_Cyrillic_zhe",
	0x06d7: "XK_Cyrillic_ve",
	0x06d8: "XK_Cyrillic_softsign",
	0x06d9: "XK_Cyrillic_yeru",
	0x06da: "XK_Cyrillic_ze",
	0x06db: "XK_Cyrillic_sha",
	0x06dc: "XK_Cyrillic_e",
	0x06dd: "XK_Cyrillic_shcha",
	0x06de: "XK_Cyrillic_che",
	0x06df: "XK_Cyrillic_hardsign",
	0x06e0: "XK_Cyrillic_YU",
	0x06e1: "XK_Cyrillic_A",
	0x06e2: "XK_Cyrillic_BE",
	0x06e3: "XK_Cyrillic_TSE",
	0x06e4: "XK_Cyrillic_DE",
	0x06e5: "XK_Cyrillic_IE",
	0x06e6: "XK_Cyrillic_EF",
	0x06e7: "XK_Cyrillic_GHE",
	0x06e8: "XK_Cyrillic_HA",
	0x06e9: "XK_Cyrillic_I",
	0x06ea: "XK_Cyrillic_SHORTI",
	0x06eb: "XK_Cyrillic_KA",
	0x06ec: "XK_Cyrillic_EL",
	0x06ed: "XK_Cyrillic_EM",
	0x06ee: "XK_Cyrillic_EN",
	0x06ef: "XK_Cyrillic_O",
	0x06f0: "XK_Cyrillic_PE",
	0x06f1: "XK_Cyrillic_YA",
	0x06f2: "XK_Cyrillic_ER",
	0x06f3: "XK_Cyrillic_ES",
	0x06f4: "XK_Cyrillic_TE",
	0x06f5: "XK_Cyrillic_U",
	0x06f6: "XK_Cyrillic_ZHE",
	0x06f7: "XK_Cyrillic_VE",
	0x06f8: "XK_Cyrillic_SOFTSIGN",
	0x06f9: "XK_Cyrillic_YERU",
	0x06fa: "XK_Cyrillic_ZE",
	0x06fb: "XK_Cyrillic_SHA",
	0x06fc: "XK_Cyrillic_E",
	0x06fd: "XK_Cyrillic_SHCHA",
	0x06fe: "XK_Cyrillic_CHE",
	0x06ff: "XK_Cyrillic_HARDSIGN",
	0x07a1: "XK_Greek_ALPHAaccent",
	0x07a2: "XK_Greek_EPSILONaccent",
	0x07a3: "XK_Greek_ETAaccent",
	0x07a4: "XK_Greek_IOTAaccent",
	0x07a5: "XK_Greek_IOTAdieresis",
	0x07a5: "XK_Greek_IOTAdiaeresis",
	0x07a7: "XK_Greek_OMICRONaccent",
	0x07a8: "XK_Greek_UPSILONaccent",
	0x07a9: "XK_Greek_UPSILONdieresis",
	0x07ab: "XK_Greek_OMEGAaccent",
	0x07ae: "XK_Greek_accentdieresis",
	0x07af: "XK_Greek_horizbar",
	0x07b1: "XK_Greek_alphaaccent",
	0x07b2: "XK_Greek_epsilonaccent",
	0x07b3: "XK_Greek_etaaccent",
	0x07b4: "XK_Greek_iotaaccent",
	0x07b5: "XK_Greek_iotadieresis",
	0x07b6: "XK_Greek_iotaaccentdieresis",
	0x07b7: "XK_Greek_omicronaccent",
	0x07b8: "XK_Greek_upsilonaccent",
	0x07b9: "XK_Greek_upsilondieresis",
	0x07ba: "XK_Greek_upsilonaccentdieresis",
	0x07bb: "XK_Greek_omegaaccent",
	0x07c1: "XK_Greek_ALPHA",
	0x07c2: "XK_Greek_BETA",
	0x07c3: "XK_Greek_GAMMA",
	0x07c4: "XK_Greek_DELTA",
	0x07c5: "XK_Greek_EPSILON",
	0x07c6: "XK_Greek_ZETA",
	0x07c7: "XK_Greek_ETA",
	0x07c8: "XK_Greek_THETA",
	0x07c9: "XK_Greek_IOTA",
	0x07ca: "XK_Greek_KAPPA",
	0x07cb: "XK_Greek_LAMDA",
	0x07cb: "XK_Greek_LAMBDA",
	0x07cc: "XK_Greek_MU",
	0x07cd: "XK_Greek_NU",
	0x07ce: "XK_Greek_XI",
	0x07cf: "XK_Greek_OMICRON",
	0x07d0: "XK_Greek_PI",
	0x07d1: "XK_Greek_RHO",
	0x07d2: "XK_Greek_SIGMA",
	0x07d4: "XK_Greek_TAU",
	0x07d5: "XK_Greek_UPSILON",
	0x07d6: "XK_Greek_PHI",
	0x07d7: "XK_Greek_CHI",
	0x07d8: "XK_Greek_PSI",
	0x07d9: "XK_Greek_OMEGA",
	0x07e1: "XK_Greek_alpha",
	0x07e2: "XK_Greek_beta",
	0x07e3: "XK_Greek_gamma",
	0x07e4: "XK_Greek_delta",
	0x07e5: "XK_Greek_epsilon",
	0x07e6: "XK_Greek_zeta",
	0x07e7: "XK_Greek_eta",
	0x07e8: "XK_Greek_theta",
	0x07e9: "XK_Greek_iota",
	0x07ea: "XK_Greek_kappa",
	0x07eb: "XK_Greek_lamda",
	0x07eb: "XK_Greek_lambda",
	0x07ec: "XK_Greek_mu",
	0x07ed: "XK_Greek_nu",
	0x07ee: "XK_Greek_xi",
	0x07ef: "XK_Greek_omicron",
	0x07f0: "XK_Greek_pi",
	0x07f1: "XK_Greek_rho",
	0x07f2: "XK_Greek_sigma",
	0x07f3: "XK_Greek_finalsmallsigma",
	0x07f4: "XK_Greek_tau",
	0x07f5: "XK_Greek_upsilon",
	0x07f6: "XK_Greek_phi",
	0x07f7: "XK_Greek_chi",
	0x07f8: "XK_Greek_psi",
	0x07f9: "XK_Greek_omega",
	0xff7e: "XK_Greek_switch",
	0x08a1: "XK_leftradical",
	0x08a2: "XK_topleftradical",
	0x08a3: "XK_horizconnector",
	0x08a4: "XK_topintegral",
	0x08a5: "XK_botintegral",
	0x08a6: "XK_vertconnector",
	0x08a7: "XK_topleftsqbracket",
	0x08a8: "XK_botleftsqbracket",
	0x08a9: "XK_toprightsqbracket",
	0x08aa: "XK_botrightsqbracket",
	0x08ab: "XK_topleftparens",
	0x08ac: "XK_botleftparens",
	0x08ad: "XK_toprightparens",
	0x08ae: "XK_botrightparens",
	0x08af: "XK_leftmiddlecurlybrace",
	0x08b0: "XK_rightmiddlecurlybrace",
	0x08b1: "XK_topleftsummation",
	0x08b2: "XK_botleftsummation",
	0x08b3: "XK_topvertsummationconnector",
	0x08b4: "XK_botvertsummationconnector",
	0x08b5: "XK_toprightsummation",
	0x08b6: "XK_botrightsummation",
	0x08b7: "XK_rightmiddlesummation",
	0x08bc: "XK_lessthanequal",
	0x08bd: "XK_notequal",
	0x08be: "XK_greaterthanequal",
	0x08bf: "XK_integral",
	0x08c0: "XK_therefore",
	0x08c1: "XK_variation",
	0x08c2: "XK_infinity",
	0x08c5: "XK_nabla",
	0x08c8: "XK_approximate",
	0x08c9: "XK_similarequal",
	0x08cd: "XK_ifonlyif",
	0x08ce: "XK_implies",
	0x08cf: "XK_identical",
	0x08d6: "XK_radical",
	0x08da: "XK_includedin",
	0x08db: "XK_includes",
	0x08dc: "XK_intersection",
	0x08dd: "XK_union",
	0x08de: "XK_logicaland",
	0x08df: "XK_logicalor",
	0x08ef: "XK_partialderivative",
	0x08f6: "XK_function",
	0x08fb: "XK_leftarrow",
	0x08fc: "XK_uparrow",
	0x08fd: "XK_rightarrow",
	0x08fe: "XK_downarrow",
	0x09df: "XK_blank",
	0x09e0: "XK_soliddiamond",
	0x09e1: "XK_checkerboard",
	0x09e2: "XK_ht",
	0x09e3: "XK_ff",
	0x09e4: "XK_cr",
	0x09e5: "XK_lf",
	0x09e8: "XK_nl",
	0x09e9: "XK_vt",
	0x09ea: "XK_lowrightcorner",
	0x09eb: "XK_uprightcorner",
	0x09ec: "XK_upleftcorner",
	0x09ed: "XK_lowleftcorner",
	0x09ee: "XK_crossinglines",
	0x09ef: "XK_horizlinescan1",
	0x09f0: "XK_horizlinescan3",
	0x09f1: "XK_horizlinescan5",
	0x09f2: "XK_horizlinescan7",
	0x09f3: "XK_horizlinescan9",
	0x09f4: "XK_leftt",
	0x09f5: "XK_rightt",
	0x09f6: "XK_bott",
	0x09f7: "XK_topt",
	0x09f8: "XK_vertbar",
	0x0aa1: "XK_emspace",
	0x0aa2: "XK_enspace",
	0x0aa3: "XK_em3space",
	0x0aa4: "XK_em4space",
	0x0aa5: "XK_digitspace",
	0x0aa6: "XK_punctspace",
	0x0aa7: "XK_thinspace",
	0x0aa8: "XK_hairspace",
	0x0aa9: "XK_emdash",
	0x0aaa: "XK_endash",
	0x0aac: "XK_signifblank",
	0x0aae: "XK_ellipsis",
	0x0aaf: "XK_doubbaselinedot",
	0x0ab0: "XK_onethird",
	0x0ab1: "XK_twothirds",
	0x0ab2: "XK_onefifth",
	0x0ab3: "XK_twofifths",
	0x0ab4: "XK_threefifths",
	0x0ab5: "XK_fourfifths",
	0x0ab6: "XK_onesixth",
	0x0ab7: "XK_fivesixths",
	0x0ab8: "XK_careof",
	0x0abb: "XK_figdash",
	0x0abc: "XK_leftanglebracket",
	0x0abd: "XK_decimalpoint",
	0x0abe: "XK_rightanglebracket",
	0x0abf: "XK_marker",
	0x0ac3: "XK_oneeighth",
	0x0ac4: "XK_threeeighths",
	0x0ac5: "XK_fiveeighths",
	0x0ac6: "XK_seveneighths",
	0x0ac9: "XK_trademark",
	0x0aca: "XK_signaturemark",
	0x0acb: "XK_trademarkincircle",
	0x0acc: "XK_leftopentriangle",
	0x0acd: "XK_rightopentriangle",
	0x0ace: "XK_emopencircle",
	0x0acf: "XK_emopenrectangle",
	0x0ad0: "XK_leftsinglequotemark",
	0x0ad1: "XK_rightsinglequotemark",
	0x0ad2: "XK_leftdoublequotemark",
	0x0ad3: "XK_rightdoublequotemark",
	0x0ad4: "XK_prescription",
	0x0ad6: "XK_minutes",
	0x0ad7: "XK_seconds",
	0x0ad9: "XK_latincross",
	0x0ada: "XK_hexagram",
	0x0adb: "XK_filledrectbullet",
	0x0adc: "XK_filledlefttribullet",
	0x0add: "XK_filledrighttribullet",
	0x0ade: "XK_emfilledcircle",
	0x0adf: "XK_emfilledrect",
	0x0ae0: "XK_enopencircbullet",
	0x0ae1: "XK_enopensquarebullet",
	0x0ae2: "XK_openrectbullet",
	0x0ae3: "XK_opentribulletup",
	0x0ae4: "XK_opentribulletdown",
	0x0ae5: "XK_openstar",
	0x0ae6: "XK_enfilledcircbullet",
	0x0ae7: "XK_enfilledsqbullet",
	0x0ae8: "XK_filledtribulletup",
	0x0ae9: "XK_filledtribulletdown",
	0x0aea: "XK_leftpointer",
	0x0aeb: "XK_rightpointer",
	0x0aec: "XK_club",
	0x0aed: "XK_diamond",
	0x0aee: "XK_heart",
	0x0af0: "XK_maltesecross",
	0x0af1: "XK_dagger",
	0x0af2: "XK_doubledagger",
	0x0af3: "XK_checkmark",
	0x0af4: "XK_ballotcross",
	0x0af5: "XK_musicalsharp",
	0x0af6: "XK_musicalflat",
	0x0af7: "XK_malesymbol",
	0x0af8: "XK_femalesymbol",
	0x0af9: "XK_telephone",
	0x0afa: "XK_telephonerecorder",
	0x0afb: "XK_phonographcopyright",
	0x0afc: "XK_caret",
	0x0afd: "XK_singlelowquotemark",
	0x0afe: "XK_doublelowquotemark",
	0x0aff: "XK_cursor",
	0x0ba3: "XK_leftcaret",
	0x0ba6: "XK_rightcaret",
	0x0ba8: "XK_downcaret",
	0x0ba9: "XK_upcaret",
	0x0bc0: "XK_overbar",
	0x0bc2: "XK_downtack",
	0x0bc3: "XK_upshoe",
	0x0bc4: "XK_downstile",
	0x0bc6: "XK_underbar",
	0x0bca: "XK_jot",
	0x0bcc: "XK_quad",
	0x0bce: "XK_uptack",
	0x0bcf: "XK_circle",
	0x0bd3: "XK_upstile",
	0x0bd6: "XK_downshoe",
	0x0bd8: "XK_rightshoe",
	0x0bda: "XK_leftshoe",
	0x0bdc: "XK_lefttack",
	0x0bfc: "XK_righttack",
	0x0cdf: "XK_hebrew_doublelowline",
	0x0ce0: "XK_hebrew_aleph",
	0x0ce1: "XK_hebrew_bet",
	0x0ce1: "XK_hebrew_beth",
	0x0ce2: "XK_hebrew_gimel",
	0x0ce2: "XK_hebrew_gimmel",
	0x0ce3: "XK_hebrew_dalet",
	0x0ce3: "XK_hebrew_daleth",
	0x0ce4: "XK_hebrew_he",
	0x0ce5: "XK_hebrew_waw",
	0x0ce6: "XK_hebrew_zain",
	0x0ce6: "XK_hebrew_zayin",
	0x0ce7: "XK_hebrew_chet",
	0x0ce7: "XK_hebrew_het",
	0x0ce8: "XK_hebrew_tet",
	0x0ce8: "XK_hebrew_teth",
	0x0ce9: "XK_hebrew_yod",
	0x0cea: "XK_hebrew_finalkaph",
	0x0ceb: "XK_hebrew_kaph",
	0x0cec: "XK_hebrew_lamed",
	0x0ced: "XK_hebrew_finalmem",
	0x0cee: "XK_hebrew_mem",
	0x0cef: "XK_hebrew_finalnun",
	0x0cf0: "XK_hebrew_nun",
	0x0cf1: "XK_hebrew_samech",
	0x0cf1: "XK_hebrew_samekh",
	0x0cf2: "XK_hebrew_ayin",
	0x0cf3: "XK_hebrew_finalpe",
	0x0cf4: "XK_hebrew_pe",
	0x0cf5: "XK_hebrew_finalzade",
	0x0cf5: "XK_hebrew_finalzadi",
	0x0cf6: "XK_hebrew_zade",
	0x0cf6: "XK_hebrew_zadi",
	0x0cf7: "XK_hebrew_qoph",
	0x0cf7: "XK_hebrew_kuf",
	0x0cf8: "XK_hebrew_resh",
	0x0cf9: "XK_hebrew_shin",
	0x0cfa: "XK_hebrew_taw",
	0x0cfa: "XK_hebrew_taf",
	0xff7e: "XK_Hebrew_switch",
	0x0da1: "XK_Thai_kokai",
	0x0da2: "XK_Thai_khokhai",
	0x0da3: "XK_Thai_khokhuat",
	0x0da4: "XK_Thai_khokhwai",
	0x0da5: "XK_Thai_khokhon",
	0x0da6: "XK_Thai_khorakhang",
	0x0da7: "XK_Thai_ngongu",
	0x0da8: "XK_Thai_chochan",
	0x0da9: "XK_Thai_choching",
	0x0daa: "XK_Thai_chochang",
	0x0dab: "XK_Thai_soso",
	0x0dac: "XK_Thai_chochoe",
	0x0dad: "XK_Thai_yoying",
	0x0dae: "XK_Thai_dochada",
	0x0daf: "XK_Thai_topatak",
	0x0db0: "XK_Thai_thothan",
	0x0db1: "XK_Thai_thonangmontho",
	0x0db2: "XK_Thai_thophuthao",
	0x0db3: "XK_Thai_nonen",
	0x0db4: "XK_Thai_dodek",
	0x0db5: "XK_Thai_totao",
	0x0db6: "XK_Thai_thothung",
	0x0db7: "XK_Thai_thothahan",
	0x0db8: "XK_Thai_thothong",
	0x0db9: "XK_Thai_nonu",
	0x0dba: "XK_Thai_bobaimai",
	0x0dbb: "XK_Thai_popla",
	0x0dbc: "XK_Thai_phophung",
	0x0dbd: "XK_Thai_fofa",
	0x0dbe: "XK_Thai_phophan",
	0x0dbf: "XK_Thai_fofan",
	0x0dc0: "XK_Thai_phosamphao",
	0x0dc1: "XK_Thai_moma",
	0x0dc2: "XK_Thai_yoyak",
	0x0dc3: "XK_Thai_rorua",
	0x0dc4: "XK_Thai_ru",
	0x0dc5: "XK_Thai_loling",
	0x0dc6: "XK_Thai_lu",
	0x0dc7: "XK_Thai_wowaen",
	0x0dc8: "XK_Thai_sosala",
	0x0dc9: "XK_Thai_sorusi",
	0x0dca: "XK_Thai_sosua",
	0x0dcb: "XK_Thai_hohip",
	0x0dcc: "XK_Thai_lochula",
	0x0dcd: "XK_Thai_oang",
	0x0dce: "XK_Thai_honokhuk",
	0x0dcf: "XK_Thai_paiyannoi",
	0x0dd0: "XK_Thai_saraa",
	0x0dd1: "XK_Thai_maihanakat",
	0x0dd2: "XK_Thai_saraaa",
	0x0dd3: "XK_Thai_saraam",
	0x0dd4: "XK_Thai_sarai",
	0x0dd5: "XK_Thai_saraii",
	0x0dd6: "XK_Thai_saraue",
	0x0dd7: "XK_Thai_sarauee",
	0x0dd8: "XK_Thai_sarau",
	0x0dd9: "XK_Thai_sarauu",
	0x0dda: "XK_Thai_phinthu",
	0x0dde: "XK_Thai_maihanakat_maitho",
	0x0ddf: "XK_Thai_baht",
	0x0de0: "XK_Thai_sarae",
	0x0de1: "XK_Thai_saraae",
	0x0de2: "XK_Thai_sarao",
	0x0de3: "XK_Thai_saraaimaimuan",
	0x0de4: "XK_Thai_saraaimaimalai",
	0x0de5: "XK_Thai_lakkhangyao",
	0x0de6: "XK_Thai_maiyamok",
	0x0de7: "XK_Thai_maitaikhu",
	0x0de8: "XK_Thai_maiek",
	0x0de9: "XK_Thai_maitho",
	0x0dea: "XK_Thai_maitri",
	0x0deb: "XK_Thai_maichattawa",
	0x0dec: "XK_Thai_thanthakhat",
	0x0ded: "XK_Thai_nikhahit",
	0x0df0: "XK_Thai_leksun",
	0x0df1: "XK_Thai_leknung",
	0x0df2: "XK_Thai_leksong",
	0x0df3: "XK_Thai_leksam",
	0x0df4: "XK_Thai_leksi",
	0x0df5: "XK_Thai_lekha",
	0x0df6: "XK_Thai_lekhok",
	0x0df7: "XK_Thai_lekchet",
	0x0df8: "XK_Thai_lekpaet",
	0x0df9: "XK_Thai_lekkao",
	0xff31: "XK_Hangul",
	0xff32: "XK_Hangul_Start",
	0xff33: "XK_Hangul_End",
	0xff34: "XK_Hangul_Hanja",
	0xff35: "XK_Hangul_Jamo",
	0xff36: "XK_Hangul_Romaja",
	0xff37: "XK_Hangul_Codeinput",
	0xff38: "XK_Hangul_Jeonja",
	0xff39: "XK_Hangul_Banja",
	0xff3a: "XK_Hangul_PreHanja",
	0xff3b: "XK_Hangul_PostHanja",
	0xff3c: "XK_Hangul_SingleCandidate",
	0xff3d: "XK_Hangul_MultipleCandidate",
	0xff3e: "XK_Hangul_PreviousCandidate",
	0xff3f: "XK_Hangul_Special",
	0xff7e: "XK_Hangul_switch",
	0x0ea1: "XK_Hangul_Kiyeog",
	0x0ea2: "XK_Hangul_SsangKiyeog",
	0x0ea3: "XK_Hangul_KiyeogSios",
	0x0ea4: "XK_Hangul_Nieun",
	0x0ea5: "XK_Hangul_NieunJieuj",
	0x0ea6: "XK_Hangul_NieunHieuh",
	0x0ea7: "XK_Hangul_Dikeud",
	0x0ea8: "XK_Hangul_SsangDikeud",
	0x0ea9: "XK_Hangul_Rieul",
	0x0eaa: "XK_Hangul_RieulKiyeog",
	0x0eab: "XK_Hangul_RieulMieum",
	0x0eac: "XK_Hangul_RieulPieub",
	0x0ead: "XK_Hangul_RieulSios",
	0x0eae: "XK_Hangul_RieulTieut",
	0x0eaf: "XK_Hangul_RieulPhieuf",
	0x0eb0: "XK_Hangul_RieulHieuh",
	0x0eb1: "XK_Hangul_Mieum",
	0x0eb2: "XK_Hangul_Pieub",
	0x0eb3: "XK_Hangul_SsangPieub",
	0x0eb4: "XK_Hangul_PieubSios",
	0x0eb5: "XK_Hangul_Sios",
	0x0eb6: "XK_Hangul_SsangSios",
	0x0eb7: "XK_Hangul_Ieung",
	0x0eb8: "XK_Hangul_Jieuj",
	0x0eb9: "XK_Hangul_SsangJieuj",
	0x0eba: "XK_Hangul_Cieuc",
	0x0ebb: "XK_Hangul_Khieuq",
	0x0ebc: "XK_Hangul_Tieut",
	0x0ebd: "XK_Hangul_Phieuf",
	0x0ebe: "XK_Hangul_Hieuh",
	0x0ebf: "XK_Hangul_A",
	0x0ec0: "XK_Hangul_AE",
	0x0ec1: "XK_Hangul_YA",
	0x0ec2: "XK_Hangul_YAE",
	0x0ec3: "XK_Hangul_EO",
	0x0ec4: "XK_Hangul_E",
	0x0ec5: "XK_Hangul_YEO",
	0x0ec6: "XK_Hangul_YE",
	0x0ec7: "XK_Hangul_O",
	0x0ec8: "XK_Hangul_WA",
	0x0ec9: "XK_Hangul_WAE",
	0x0eca: "XK_Hangul_OE",
	0x0ecb: "XK_Hangul_YO",
	0x0ecc: "XK_Hangul_U",
	0x0ecd: "XK_Hangul_WEO",
	0x0ece: "XK_Hangul_WE",
	0x0ecf: "XK_Hangul_WI",
	0x0ed0: "XK_Hangul_YU",
	0x0ed1: "XK_Hangul_EU",
	0x0ed2: "XK_Hangul_YI",
	0x0ed3: "XK_Hangul_I",
	0x0ed4: "XK_Hangul_J_Kiyeog",
	0x0ed5: "XK_Hangul_J_SsangKiyeog",
	0x0ed6: "XK_Hangul_J_KiyeogSios",
	0x0ed7: "XK_Hangul_J_Nieun",
	0x0ed8: "XK_Hangul_J_NieunJieuj",
	0x0ed9: "XK_Hangul_J_NieunHieuh",
	0x0eda: "XK_Hangul_J_Dikeud",
	0x0edb: "XK_Hangul_J_Rieul",
	0x0edc: "XK_Hangul_J_RieulKiyeog",
	0x0edd: "XK_Hangul_J_RieulMieum",
	0x0ede: "XK_Hangul_J_RieulPieub",
	0x0edf: "XK_Hangul_J_RieulSios",
	0x0ee0: "XK_Hangul_J_RieulTieut",
	0x0ee1: "XK_Hangul_J_RieulPhieuf",
	0x0ee2: "XK_Hangul_J_RieulHieuh",
	0x0ee3: "XK_Hangul_J_Mieum",
	0x0ee4: "XK_Hangul_J_Pieub",
	0x0ee5: "XK_Hangul_J_PieubSios",
	0x0ee6: "XK_Hangul_J_Sios",
	0x0ee7: "XK_Hangul_J_SsangSios",
	0x0ee8: "XK_Hangul_J_Ieung",
	0x0ee9: "XK_Hangul_J_Jieuj",
	0x0eea: "XK_Hangul_J_Cieuc",
	0x0eeb: "XK_Hangul_J_Khieuq",
	0x0eec: "XK_Hangul_J_Tieut",
	0x0eed: "XK_Hangul_J_Phieuf",
	0x0eee: "XK_Hangul_J_Hieuh",
	0x0eef: "XK_Hangul_RieulYeorinHieuh",
	0x0ef0: "XK_Hangul_SunkyeongeumMieum",
	0x0ef1: "XK_Hangul_SunkyeongeumPieub",
	0x0ef2: "XK_Hangul_PanSios",
	0x0ef3: "XK_Hangul_KkogjiDalrinIeung",
	0x0ef4: "XK_Hangul_SunkyeongeumPhieuf",
	0x0ef5: "XK_Hangul_YeorinHieuh",
	0x0ef6: "XK_Hangul_AraeA",
	0x0ef7: "XK_Hangul_AraeAE",
	0x0ef8: "XK_Hangul_J_PanSios",
	0x0ef9: "XK_Hangul_J_KkogjiDalrinIeung",
	0x0efa: "XK_Hangul_J_YeorinHieuh",
	0x0eff: "XK_Korean_Won",
	0x1000587: "XK_Armenian_ligature_ew",
	0x1000589: "XK_Armenian_full_stop",
	0x1000589: "XK_Armenian_verjaket",
	0x100055d: "XK_Armenian_separation_mark",
	0x100055d: "XK_Armenian_but",
	0x100058a: "XK_Armenian_hyphen",
	0x100058a: "XK_Armenian_yentamna",
	0x100055c: "XK_Armenian_exclam",
	0x100055c: "XK_Armenian_amanak",
	0x100055b: "XK_Armenian_accent",
	0x100055b: "XK_Armenian_shesht",
	0x100055e: "XK_Armenian_question",
	0x100055e: "XK_Armenian_paruyk",
	0x1000531: "XK_Armenian_AYB",
	0x1000561: "XK_Armenian_ayb",
	0x1000532: "XK_Armenian_BEN",
	0x1000562: "XK_Armenian_ben",
	0x1000533: "XK_Armenian_GIM",
	0x1000563: "XK_Armenian_gim",
	0x1000534: "XK_Armenian_DA",
	0x1000564: "XK_Armenian_da",
	0x1000535: "XK_Armenian_YECH",
	0x1000565: "XK_Armenian_yech",
	0x1000536: "XK_Armenian_ZA",
	0x1000566: "XK_Armenian_za",
	0x1000537: "XK_Armenian_E",
	0x1000567: "XK_Armenian_e",
	0x1000538: "XK_Armenian_AT",
	0x1000568: "XK_Armenian_at",
	0x1000539: "XK_Armenian_TO",
	0x1000569: "XK_Armenian_to",
	0x100053a: "XK_Armenian_ZHE",
	0x100056a: "XK_Armenian_zhe",
	0x100053b: "XK_Armenian_INI",
	0x100056b: "XK_Armenian_ini",
	0x100053c: "XK_Armenian_LYUN",
	0x100056c: "XK_Armenian_lyun",
	0x100053d: "XK_Armenian_KHE",
	0x100056d: "XK_Armenian_khe",
	0x100053e: "XK_Armenian_TSA",
	0x100056e: "XK_Armenian_tsa",
	0x100053f: "XK_Armenian_KEN",
	0x100056f: "XK_Armenian_ken",
	0x1000540: "XK_Armenian_HO",
	0x1000570: "XK_Armenian_ho",
	0x1000541: "XK_Armenian_DZA",
	0x1000571: "XK_Armenian_dza",
	0x1000542: "XK_Armenian_GHAT",
	0x1000572: "XK_Armenian_ghat",
	0x1000543: "XK_Armenian_TCHE",
	0x1000573: "XK_Armenian_tche",
	0x1000544: "XK_Armenian_MEN",
	0x1000574: "XK_Armenian_men",
	0x1000545: "XK_Armenian_HI",
	0x1000575: "XK_Armenian_hi",
	0x1000546: "XK_Armenian_NU",
	0x1000576: "XK_Armenian_nu",
	0x1000547: "XK_Armenian_SHA",
	0x1000577: "XK_Armenian_sha",
	0x1000548: "XK_Armenian_VO",
	0x1000578: "XK_Armenian_vo",
	0x1000549: "XK_Armenian_CHA",
	0x1000579: "XK_Armenian_cha",
	0x100054a: "XK_Armenian_PE",
	0x100057a: "XK_Armenian_pe",
	0x100054b: "XK_Armenian_JE",
	0x100057b: "XK_Armenian_je",
	0x100054c: "XK_Armenian_RA",
	0x100057c: "XK_Armenian_ra",
	0x100054d: "XK_Armenian_SE",
	0x100057d: "XK_Armenian_se",
	0x100054e: "XK_Armenian_VEV",
	0x100057e: "XK_Armenian_vev",
	0x100054f: "XK_Armenian_TYUN",
	0x100057f: "XK_Armenian_tyun",
	0x1000550: "XK_Armenian_RE",
	0x1000580: "XK_Armenian_re",
	0x1000551: "XK_Armenian_TSO",
	0x1000581: "XK_Armenian_tso",
	0x1000552: "XK_Armenian_VYUN",
	0x1000582: "XK_Armenian_vyun",
	0x1000553: "XK_Armenian_PYUR",
	0x1000583: "XK_Armenian_pyur",
	0x1000554: "XK_Armenian_KE",
	0x1000584: "XK_Armenian_ke",
	0x1000555: "XK_Armenian_O",
	0x1000585: "XK_Armenian_o",
	0x1000556: "XK_Armenian_FE",
	0x1000586: "XK_Armenian_fe",
	0x100055a: "XK_Armenian_apostrophe",
	0x10010d0: "XK_Georgian_an",
	0x10010d1: "XK_Georgian_ban",
	0x10010d2: "XK_Georgian_gan",
	0x10010d3: "XK_Georgian_don",
	0x10010d4: "XK_Georgian_en",
	0x10010d5: "XK_Georgian_vin",
	0x10010d6: "XK_Georgian_zen",
	0x10010d7: "XK_Georgian_tan",
	0x10010d8: "XK_Georgian_in",
	0x10010d9: "XK_Georgian_kan",
	0x10010da: "XK_Georgian_las",
	0x10010db: "XK_Georgian_man",
	0x10010dc: "XK_Georgian_nar",
	0x10010dd: "XK_Georgian_on",
	0x10010de: "XK_Georgian_par",
	0x10010df: "XK_Georgian_zhar",
	0x10010e0: "XK_Georgian_rae",
	0x10010e1: "XK_Georgian_san",
	0x10010e2: "XK_Georgian_tar",
	0x10010e3: "XK_Georgian_un",
	0x10010e4: "XK_Georgian_phar",
	0x10010e5: "XK_Georgian_khar",
	0x10010e6: "XK_Georgian_ghan",
	0x10010e7: "XK_Georgian_qar",
	0x10010e8: "XK_Georgian_shin",
	0x10010e9: "XK_Georgian_chin",
	0x10010ea: "XK_Georgian_can",
	0x10010eb: "XK_Georgian_jil",
	0x10010ec: "XK_Georgian_cil",
	0x10010ed: "XK_Georgian_char",
	0x10010ee: "XK_Georgian_xan",
	0x10010ef: "XK_Georgian_jhan",
	0x10010f0: "XK_Georgian_hae",
	0x10010f1: "XK_Georgian_he",
	0x10010f2: "XK_Georgian_hie",
	0x10010f3: "XK_Georgian_we",
	0x10010f4: "XK_Georgian_har",
	0x10010f5: "XK_Georgian_hoe",
	0x10010f6: "XK_Georgian_fi",
	0x1001e8a: "XK_Xabovedot",
	0x100012c: "XK_Ibreve",
	0x10001b5: "XK_Zstroke",
	0x10001e6: "XK_Gcaron",
	0x10001d1: "XK_Ocaron",
	0x100019f: "XK_Obarred",
	0x1001e8b: "XK_xabovedot",
	0x100012d: "XK_ibreve",
	0x10001b6: "XK_zstroke",
	0x10001e7: "XK_gcaron",
	0x10001d2: "XK_ocaron",
	0x1000275: "XK_obarred",
	0x100018f: "XK_SCHWA",
	0x1000259: "XK_schwa",
	0x1001e36: "XK_Lbelowdot",
	0x1001e37: "XK_lbelowdot",
	0x1001ea0: "XK_Abelowdot",
	0x1001ea1: "XK_abelowdot",
	0x1001ea2: "XK_Ahook",
	0x1001ea3: "XK_ahook",
	0x1001ea4: "XK_Acircumflexacute",
	0x1001ea5: "XK_acircumflexacute",
	0x1001ea6: "XK_Acircumflexgrave",
	0x1001ea7: "XK_acircumflexgrave",
	0x1001ea8: "XK_Acircumflexhook",
	0x1001ea9: "XK_acircumflexhook",
	0x1001eaa: "XK_Acircumflextilde",
	0x1001eab: "XK_acircumflextilde",
	0x1001eac: "XK_Acircumflexbelowdot",
	0x1001ead: "XK_acircumflexbelowdot",
	0x1001eae: "XK_Abreveacute",
	0x1001eaf: "XK_abreveacute",
	0x1001eb0: "XK_Abrevegrave",
	0x1001eb1: "XK_abrevegrave",
	0x1001eb2: "XK_Abrevehook",
	0x1001eb3: "XK_abrevehook",
	0x1001eb4: "XK_Abrevetilde",
	0x1001eb5: "XK_abrevetilde",
	0x1001eb6: "XK_Abrevebelowdot",
	0x1001eb7: "XK_abrevebelowdot",
	0x1001eb8: "XK_Ebelowdot",
	0x1001eb9: "XK_ebelowdot",
	0x1001eba: "XK_Ehook",
	0x1001ebb: "XK_ehook",
	0x1001ebc: "XK_Etilde",
	0x1001ebd: "XK_etilde",
	0x1001ebe: "XK_Ecircumflexacute",
	0x1001ebf: "XK_ecircumflexacute",
	0x1001ec0: "XK_Ecircumflexgrave",
	0x1001ec1: "XK_ecircumflexgrave",
	0x1001ec2: "XK_Ecircumflexhook",
	0x1001ec3: "XK_ecircumflexhook",
	0x1001ec4: "XK_Ecircumflextilde",
	0x1001ec5: "XK_ecircumflextilde",
	0x1001ec6: "XK_Ecircumflexbelowdot",
	0x1001ec7: "XK_ecircumflexbelowdot",
	0x1001ec8: "XK_Ihook",
	0x1001ec9: "XK_ihook",
	0x1001eca: "XK_Ibelowdot",
	0x1001ecb: "XK_ibelowdot",
	0x1001ecc: "XK_Obelowdot",
	0x1001ecd: "XK_obelowdot",
	0x1001ece: "XK_Ohook",
	0x1001ecf: "XK_ohook",
	0x1001ed0: "XK_Ocircumflexacute",
	0x1001ed1: "XK_ocircumflexacute",
	0x1001ed2: "XK_Ocircumflexgrave",
	0x1001ed3: "XK_ocircumflexgrave",
	0x1001ed4: "XK_Ocircumflexhook",
	0x1001ed5: "XK_ocircumflexhook",
	0x1001ed6: "XK_Ocircumflextilde",
	0x1001ed7: "XK_ocircumflextilde",
	0x1001ed8: "XK_Ocircumflexbelowdot",
	0x1001ed9: "XK_ocircumflexbelowdot",
	0x1001eda: "XK_Ohornacute",
	0x1001edb: "XK_ohornacute",
	0x1001edc: "XK_Ohorngrave",
	0x1001edd: "XK_ohorngrave",
	0x1001ede: "XK_Ohornhook",
	0x1001edf: "XK_ohornhook",
	0x1001ee0: "XK_Ohorntilde",
	0x1001ee1: "XK_ohorntilde",
	0x1001ee2: "XK_Ohornbelowdot",
	0x1001ee3: "XK_ohornbelowdot",
	0x1001ee4: "XK_Ubelowdot",
	0x1001ee5: "XK_ubelowdot",
	0x1001ee6: "XK_Uhook",
	0x1001ee7: "XK_uhook",
	0x1001ee8: "XK_Uhornacute",
	0x1001ee9: "XK_uhornacute",
	0x1001eea: "XK_Uhorngrave",
	0x1001eeb: "XK_uhorngrave",
	0x1001eec: "XK_Uhornhook",
	0x1001eed: "XK_uhornhook",
	0x1001eee: "XK_Uhorntilde",
	0x1001eef: "XK_uhorntilde",
	0x1001ef0: "XK_Uhornbelowdot",
	0x1001ef1: "XK_uhornbelowdot",
	0x1001ef4: "XK_Ybelowdot",
	0x1001ef5: "XK_ybelowdot",
	0x1001ef6: "XK_Yhook",
	0x1001ef7: "XK_yhook",
	0x1001ef8: "XK_Ytilde",
	0x1001ef9: "XK_ytilde",
	0x10001a0: "XK_Ohorn",
	0x10001a1: "XK_ohorn",
	0x10001af: "XK_Uhorn",
	0x10001b0: "XK_uhorn",
	0x10020a0: "XK_EcuSign",
	0x10020a1: "XK_ColonSign",
	0x10020a2: "XK_CruzeiroSign",
	0x10020a3: "XK_FFrancSign",
	0x10020a4: "XK_LiraSign",
	0x10020a5: "XK_MillSign",
	0x10020a6: "XK_NairaSign",
	0x10020a7: "XK_PesetaSign",
	0x10020a8: "XK_RupeeSign",
	0x10020a9: "XK_WonSign",
	0x10020aa: "XK_NewSheqelSign",
	0x10020ab: "XK_DongSign",
	0x20ac: "XK_EuroSign"
}

if len(sys.argv) == 4:
	listenPort = int(sys.argv[1])
	serverHost = sys.argv[2]
	serverPort = int(sys.argv[3])
	listenSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	listenSocket.bind(("localhost", listenPort))
	listenSocket.listen(0)
else:
	raise SystemExit("Usage: " + sys.argv[0].split('/')[-1] + " listenPort serverHost serverPort")

while True:
	clientConnection, clientAddress = listenSocket.accept()
	print "Accepted connection from", clientAddress
	serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	serverSocket.connect((serverHost, serverPort))
	print "Connected to server"
	prevButtonMask = 0
	while True:
		readable, writeable, exceptions = select.select([clientConnection, serverSocket], [clientConnection, serverSocket], [clientConnection, serverSocket])
		if clientConnection in readable and serverSocket in writeable:
			dataFromClient = clientConnection.recv(8192*1024)
			if 0 == len(dataFromClient):
				print "Client closed connection"
				clientConnection.close()
				serverSocket.close()
				break
			#print "Received", len(dataFromClient), "Bytes from client"
			serverSocket.sendall(dataFromClient)
			messageType = struct.unpack(">B", dataFromClient[0])[0]
			if 4 == messageType and 8 <= len(dataFromClient):
				downFlag, key = struct.unpack(">BxxI", dataFromClient[1:8])
				print "KeyEvent: down=" + str(downFlag) + " key=" + hex(key),
				if key < 0x100:
					print "char='" + chr(key).decode("iso-8859-1") + "'",
				if key in keyNames:
					print "name=" + keyNames[key]
				else:
					print
			elif 5 == messageType and 6 <= len(dataFromClient):
				buttonMask, xPosition, yPosition = struct.unpack(">BHH", dataFromClient[1:6])
				if prevButtonMask != buttonMask:
					print "PointerEvent: buttons=" + bin(buttonMask) + " xPos=" + str(xPosition) + " yPos=" + str(yPosition)
					prevButtonMask = buttonMask

			#print "Sent data to server"
		if serverSocket in readable and clientConnection in writeable:
			dataFromServer = serverSocket.recv(8192*1024)
			if 0 == len(dataFromServer):
				print "Server closed connection"
				clientConnection.close()
				serverSocket.close()
				break
			#print "Received", len(dataFromServer), "Bytes from server"
			clientConnection.sendall(dataFromServer)
			#print "Sent data to client"

		if len(exceptions):
			connection.close()
			serverSocket.close()
			break
			
