
// ASCII Keymap
// copied from SDL.pas
  K_UNKNOWN = 0;
{$EXTERNALSYM K_UNKNOWN}
  K_FIRST = 0;
{$EXTERNALSYM K_FIRST}
  K_BACKSPACE = 8;
{$EXTERNALSYM K_BACKSPACE}
  K_TAB = 9;
{$EXTERNALSYM K_TAB}
  K_CLEAR = 12;
{$EXTERNALSYM K_CLEAR}
  K_RETURN = 13;
{$EXTERNALSYM K_RETURN}
  K_PAUSE = 19;
{$EXTERNALSYM K_PAUSE}
  K_ESCAPE = 27;
{$EXTERNALSYM K_ESCAPE}
  K_SPACE = 32;
{$EXTERNALSYM K_SPACE}
  K_EXCLAIM = 33;
{$EXTERNALSYM K_EXCLAIM}
  K_QUOTEDBL = 34;
{$EXTERNALSYM K_QUOTEDBL}
  K_HASH = 35;
{$EXTERNALSYM K_HASH}
  K_DOLLAR = 36;
{$EXTERNALSYM K_DOLLAR}
  K_AMPERSAND = 38;
{$EXTERNALSYM K_AMPERSAND}
  K_QUOTE = 39;
{$EXTERNALSYM K_QUOTE}
  K_LEFTPAREN = 40;
{$EXTERNALSYM K_LEFTPAREN}
  K_RIGHTPAREN = 41;
{$EXTERNALSYM K_RIGHTPAREN}
  K_ASTERISK = 42;
{$EXTERNALSYM K_ASTERISK}
  K_PLUS = 43;
{$EXTERNALSYM K_PLUS}
  K_COMMA = 44;
{$EXTERNALSYM K_COMMA}
  K_MINUS = 45;
{$EXTERNALSYM K_MINUS}
  K_PERIOD = 46;
{$EXTERNALSYM K_PERIOD}
  K_SLASH = 47;
{$EXTERNALSYM K_SLASH}
  K_0 = 48;
{$EXTERNALSYM K_0}
  K_1 = 49;
{$EXTERNALSYM K_1}
  K_2 = 50;
{$EXTERNALSYM K_2}
  K_3 = 51;
{$EXTERNALSYM K_3}
  K_4 = 52;
{$EXTERNALSYM K_4}
  K_5 = 53;
{$EXTERNALSYM K_5}
  K_6 = 54;
{$EXTERNALSYM K_6}
  K_7 = 55;
{$EXTERNALSYM K_7}
  K_8 = 56;
{$EXTERNALSYM K_8}
  K_9 = 57;
{$EXTERNALSYM K_9}
  K_COLON = 58;
{$EXTERNALSYM K_COLON}
  K_SEMICOLON = 59;
{$EXTERNALSYM K_SEMICOLON}
  K_LESS = 60;
{$EXTERNALSYM K_LESS}
  K_EQUALS = 61;
{$EXTERNALSYM K_EQUALS}
  K_GREATER = 62;
{$EXTERNALSYM K_GREATER}
  K_QUESTION = 63;
{$EXTERNALSYM K_QUESTION}
  K_AT = 64;
{$EXTERNALSYM K_AT}

  { Skip uppercase letters }

  K_LEFTBRACKET = 91;
{$EXTERNALSYM K_LEFTBRACKET}
  K_BACKSLASH = 92;
{$EXTERNALSYM K_BACKSLASH}
  K_RIGHTBRACKET = 93;
{$EXTERNALSYM K_RIGHTBRACKET}
  K_CARET = 94;
{$EXTERNALSYM K_CARET}
  K_UNDERSCORE = 95;
{$EXTERNALSYM K_UNDERSCORE}
  K_BACKQUOTE = 96;
{$EXTERNALSYM K_BACKQUOTE}
  K_a = 97;
{$EXTERNALSYM K_a}
  K_b = 98;
{$EXTERNALSYM K_b}
  K_c = 99;
{$EXTERNALSYM K_c}
  K_d = 100;
{$EXTERNALSYM K_d}
  K_e = 101;
{$EXTERNALSYM K_e}
  K_f = 102;
{$EXTERNALSYM K_f}
  K_g = 103;
{$EXTERNALSYM K_g}
  K_h = 104;
{$EXTERNALSYM K_h}
  K_i = 105;
{$EXTERNALSYM K_i}
  K_j = 106;
{$EXTERNALSYM K_j}
  K_k = 107;
{$EXTERNALSYM K_k}
  K_l = 108;
{$EXTERNALSYM K_l}
  K_m = 109;
{$EXTERNALSYM K_m}
  K_n = 110;
{$EXTERNALSYM K_n}
  K_o = 111;
{$EXTERNALSYM K_o}
  K_p = 112;
{$EXTERNALSYM K_p}
  K_q = 113;
{$EXTERNALSYM K_q}
  K_r = 114;
{$EXTERNALSYM K_r}
  K_s = 115;
{$EXTERNALSYM K_s}
  K_t = 116;
{$EXTERNALSYM K_t}
  K_u = 117;
{$EXTERNALSYM K_u}
  K_v = 118;
{$EXTERNALSYM K_v}
  K_w = 119;
{$EXTERNALSYM K_w}
  K_x = 120;
{$EXTERNALSYM K_x}
  K_y = 121;
{$EXTERNALSYM K_y}
  K_z = 122;
{$EXTERNALSYM K_z}
  K_DELETE = 127;
{$EXTERNALSYM K_DELETE}
  // End of ASCII mapped keysyms

  // International keyboard syms
  K_WORLD_0 = 160; // 0xA0
{$EXTERNALSYM K_WORLD_0}
  K_WORLD_1 = 161;
{$EXTERNALSYM K_WORLD_1}
  K_WORLD_2 = 162;
{$EXTERNALSYM K_WORLD_2}
  K_WORLD_3 = 163;
{$EXTERNALSYM K_WORLD_3}
  K_WORLD_4 = 164;
{$EXTERNALSYM K_WORLD_4}
  K_WORLD_5 = 165;
{$EXTERNALSYM K_WORLD_5}
  K_WORLD_6 = 166;
{$EXTERNALSYM K_WORLD_6}
  K_WORLD_7 = 167;
{$EXTERNALSYM K_WORLD_7}
  K_WORLD_8 = 168;
{$EXTERNALSYM K_WORLD_8}
  K_WORLD_9 = 169;
{$EXTERNALSYM K_WORLD_9}
  K_WORLD_10 = 170;
{$EXTERNALSYM K_WORLD_10}
  K_WORLD_11 = 171;
{$EXTERNALSYM K_WORLD_11}
  K_WORLD_12 = 172;
{$EXTERNALSYM K_WORLD_12}
  K_WORLD_13 = 173;
{$EXTERNALSYM K_WORLD_13}
  K_WORLD_14 = 174;
{$EXTERNALSYM K_WORLD_14}
  K_WORLD_15 = 175;
{$EXTERNALSYM K_WORLD_15}
  K_WORLD_16 = 176;
{$EXTERNALSYM K_WORLD_16}
  K_WORLD_17 = 177;
{$EXTERNALSYM K_WORLD_17}
  K_WORLD_18 = 178;
{$EXTERNALSYM K_WORLD_18}
  K_WORLD_19 = 179;
{$EXTERNALSYM K_WORLD_19}
  K_WORLD_20 = 180;
{$EXTERNALSYM K_WORLD_20}
  K_WORLD_21 = 181;
{$EXTERNALSYM K_WORLD_21}
  K_WORLD_22 = 182;
{$EXTERNALSYM K_WORLD_22}
  K_WORLD_23 = 183;
{$EXTERNALSYM K_WORLD_23}
  K_WORLD_24 = 184;
{$EXTERNALSYM K_WORLD_24}
  K_WORLD_25 = 185;
{$EXTERNALSYM K_WORLD_25}
  K_WORLD_26 = 186;
{$EXTERNALSYM K_WORLD_26}
  K_WORLD_27 = 187;
{$EXTERNALSYM K_WORLD_27}
  K_WORLD_28 = 188;
{$EXTERNALSYM K_WORLD_28}
  K_WORLD_29 = 189;
{$EXTERNALSYM K_WORLD_29}
  K_WORLD_30 = 190;
{$EXTERNALSYM K_WORLD_30}
  K_WORLD_31 = 191;
{$EXTERNALSYM K_WORLD_31}
  K_WORLD_32 = 192;
{$EXTERNALSYM K_WORLD_32}
  K_WORLD_33 = 193;
{$EXTERNALSYM K_WORLD_33}
  K_WORLD_34 = 194;
{$EXTERNALSYM K_WORLD_34}
  K_WORLD_35 = 195;
{$EXTERNALSYM K_WORLD_35}
  K_WORLD_36 = 196;
{$EXTERNALSYM K_WORLD_36}
  K_WORLD_37 = 197;
{$EXTERNALSYM K_WORLD_37}
  K_WORLD_38 = 198;
{$EXTERNALSYM K_WORLD_38}
  K_WORLD_39 = 199;
{$EXTERNALSYM K_WORLD_39}
  K_WORLD_40 = 200;
{$EXTERNALSYM K_WORLD_40}
  K_WORLD_41 = 201;
{$EXTERNALSYM K_WORLD_41}
  K_WORLD_42 = 202;
{$EXTERNALSYM K_WORLD_42}
  K_WORLD_43 = 203;
{$EXTERNALSYM K_WORLD_43}
  K_WORLD_44 = 204;
{$EXTERNALSYM K_WORLD_44}
  K_WORLD_45 = 205;
{$EXTERNALSYM K_WORLD_45}
  K_WORLD_46 = 206;
{$EXTERNALSYM K_WORLD_46}
  K_WORLD_47 = 207;
{$EXTERNALSYM K_WORLD_47}
  K_WORLD_48 = 208;
{$EXTERNALSYM K_WORLD_48}
  K_WORLD_49 = 209;
{$EXTERNALSYM K_WORLD_49}
  K_WORLD_50 = 210;
{$EXTERNALSYM K_WORLD_50}
  K_WORLD_51 = 211;
{$EXTERNALSYM K_WORLD_51}
  K_WORLD_52 = 212;
{$EXTERNALSYM K_WORLD_52}
  K_WORLD_53 = 213;
{$EXTERNALSYM K_WORLD_53}
  K_WORLD_54 = 214;
{$EXTERNALSYM K_WORLD_54}
  K_WORLD_55 = 215;
{$EXTERNALSYM K_WORLD_55}
  K_WORLD_56 = 216;
{$EXTERNALSYM K_WORLD_56}
  K_WORLD_57 = 217;
{$EXTERNALSYM K_WORLD_57}
  K_WORLD_58 = 218;
{$EXTERNALSYM K_WORLD_58}
  K_WORLD_59 = 219;
{$EXTERNALSYM K_WORLD_59}
  K_WORLD_60 = 220;
{$EXTERNALSYM K_WORLD_60}
  K_WORLD_61 = 221;
{$EXTERNALSYM K_WORLD_61}
  K_WORLD_62 = 222;
{$EXTERNALSYM K_WORLD_62}
  K_WORLD_63 = 223;
{$EXTERNALSYM K_WORLD_63}
  K_WORLD_64 = 224;
{$EXTERNALSYM K_WORLD_64}
  K_WORLD_65 = 225;
{$EXTERNALSYM K_WORLD_65}
  K_WORLD_66 = 226;
{$EXTERNALSYM K_WORLD_66}
  K_WORLD_67 = 227;
{$EXTERNALSYM K_WORLD_67}
  K_WORLD_68 = 228;
{$EXTERNALSYM K_WORLD_68}
  K_WORLD_69 = 229;
{$EXTERNALSYM K_WORLD_69}
  K_WORLD_70 = 230;
{$EXTERNALSYM K_WORLD_70}
  K_WORLD_71 = 231;
{$EXTERNALSYM K_WORLD_71}
  K_WORLD_72 = 232;
{$EXTERNALSYM K_WORLD_72}
  K_WORLD_73 = 233;
{$EXTERNALSYM K_WORLD_73}
  K_WORLD_74 = 234;
{$EXTERNALSYM K_WORLD_74}
  K_WORLD_75 = 235;
{$EXTERNALSYM K_WORLD_75}
  K_WORLD_76 = 236;
{$EXTERNALSYM K_WORLD_76}
  K_WORLD_77 = 237;
{$EXTERNALSYM K_WORLD_77}
  K_WORLD_78 = 238;
{$EXTERNALSYM K_WORLD_78}
  K_WORLD_79 = 239;
{$EXTERNALSYM K_WORLD_79}
  K_WORLD_80 = 240;
{$EXTERNALSYM K_WORLD_80}
  K_WORLD_81 = 241;
{$EXTERNALSYM K_WORLD_81}
  K_WORLD_82 = 242;
{$EXTERNALSYM K_WORLD_82}
  K_WORLD_83 = 243;
{$EXTERNALSYM K_WORLD_83}
  K_WORLD_84 = 244;
{$EXTERNALSYM K_WORLD_84}
  K_WORLD_85 = 245;
{$EXTERNALSYM K_WORLD_85}
  K_WORLD_86 = 246;
{$EXTERNALSYM K_WORLD_86}
  K_WORLD_87 = 247;
{$EXTERNALSYM K_WORLD_87}
  K_WORLD_88 = 248;
{$EXTERNALSYM K_WORLD_88}
  K_WORLD_89 = 249;
{$EXTERNALSYM K_WORLD_89}
  K_WORLD_90 = 250;
{$EXTERNALSYM K_WORLD_90}
  K_WORLD_91 = 251;
{$EXTERNALSYM K_WORLD_91}
  K_WORLD_92 = 252;
{$EXTERNALSYM K_WORLD_92}
  K_WORLD_93 = 253;
{$EXTERNALSYM K_WORLD_93}
  K_WORLD_94 = 254;
{$EXTERNALSYM K_WORLD_94}
  K_WORLD_95 = 255; // 0xFF
{$EXTERNALSYM K_WORLD_95}

  // Numeric keypad
  K_KP0 = 256;
{$EXTERNALSYM K_KP0}
  K_KP1 = 257;
{$EXTERNALSYM K_KP1}
  K_KP2 = 258;
{$EXTERNALSYM K_KP2}
  K_KP3 = 259;
{$EXTERNALSYM K_KP3}
  K_KP4 = 260;
{$EXTERNALSYM K_KP4}
  K_KP5 = 261;
{$EXTERNALSYM K_KP5}
  K_KP6 = 262;
{$EXTERNALSYM K_KP6}
  K_KP7 = 263;
{$EXTERNALSYM K_KP7}
  K_KP8 = 264;
{$EXTERNALSYM K_KP8}
  K_KP9 = 265;
{$EXTERNALSYM K_KP9}
  K_KP_PERIOD = 266;
{$EXTERNALSYM K_KP_PERIOD}
  K_KP_DIVIDE = 267;
{$EXTERNALSYM K_KP_DIVIDE}
  K_KP_MULTIPLY = 268;
{$EXTERNALSYM K_KP_MULTIPLY}
  K_KP_MINUS = 269;
{$EXTERNALSYM K_KP_MINUS}
  K_KP_PLUS = 270;
{$EXTERNALSYM K_KP_PLUS}
  K_KP_ENTER = 271;
{$EXTERNALSYM K_KP_ENTER}
  K_KP_EQUALS = 272;
{$EXTERNALSYM K_KP_EQUALS}

  // Arrows + Home/End pad
  K_UP = 273;
{$EXTERNALSYM K_UP}
  K_DOWN = 274;
{$EXTERNALSYM K_DOWN}
  K_RIGHT = 275;
{$EXTERNALSYM K_RIGHT}
  K_LEFT = 276;
{$EXTERNALSYM K_LEFT}
  K_INSERT = 277;
{$EXTERNALSYM K_INSERT}
  K_HOME = 278;
{$EXTERNALSYM K_HOME}
  K_END = 279;
{$EXTERNALSYM K_END}
  K_PAGEUP = 280;
{$EXTERNALSYM K_PAGEUP}
  K_PAGEDOWN = 281;
{$EXTERNALSYM K_PAGEDOWN}

  // Function keys
  K_F1 = 282;
{$EXTERNALSYM K_F1}
  K_F2 = 283;
{$EXTERNALSYM K_F2}
  K_F3 = 284;
{$EXTERNALSYM K_F3}
  K_F4 = 285;
{$EXTERNALSYM K_F4}
  K_F5 = 286;
{$EXTERNALSYM K_F5}
  K_F6 = 287;
{$EXTERNALSYM K_F6}
  K_F7 = 288;
{$EXTERNALSYM K_F7}
  K_F8 = 289;
{$EXTERNALSYM K_F8}
  K_F9 = 290;
{$EXTERNALSYM K_F9}
  K_F10 = 291;
{$EXTERNALSYM K_F10}
  K_F11 = 292;
{$EXTERNALSYM K_F11}
  K_F12 = 293;
{$EXTERNALSYM K_F12}
  K_F13 = 294;
{$EXTERNALSYM K_F13}
  K_F14 = 295;
{$EXTERNALSYM K_F14}
  K_F15 = 296;
{$EXTERNALSYM K_F15}

  // Key state modifier keys
  K_NUMLOCK = 300;
{$EXTERNALSYM K_NUMLOCK}
  K_CAPSLOCK = 301;
{$EXTERNALSYM K_CAPSLOCK}
  K_SCROLLOCK = 302;
{$EXTERNALSYM K_SCROLLOCK}
  K_RSHIFT = 303;
{$EXTERNALSYM K_RSHIFT}
  K_LSHIFT = 304;
{$EXTERNALSYM K_LSHIFT}
  K_RCTRL = 305;
{$EXTERNALSYM K_RCTRL}
  K_LCTRL = 306;
{$EXTERNALSYM K_LCTRL}
  K_RALT = 307;
{$EXTERNALSYM K_RALT}
  K_LALT = 308;
{$EXTERNALSYM K_LALT}
  K_RMETA = 309;
{$EXTERNALSYM K_RMETA}
  K_LMETA = 310;
{$EXTERNALSYM K_LMETA}
  K_LSUPER = 311; // Left "Windows" key
{$EXTERNALSYM K_LSUPER}
  K_RSUPER = 312; // Right "Windows" key
{$EXTERNALSYM K_RSUPER}
  K_MODE = 313; // "Alt Gr" key
{$EXTERNALSYM K_MODE}
  K_COMPOSE = 314; // Multi-key compose key
{$EXTERNALSYM K_COMPOSE}

  // Miscellaneous function keys
  K_HELP = 315;
{$EXTERNALSYM K_HELP}
  K_PRINT = 316;
{$EXTERNALSYM K_PRINT}
  K_SYSREQ = 317;
{$EXTERNALSYM K_SYSREQ}
  K_BREAK = 318;
{$EXTERNALSYM K_BREAK}
  K_MENU = 319;
{$EXTERNALSYM K_MENU}
  K_POWER = 320; // Power Macintosh power key
{$EXTERNALSYM K_POWER}
  K_EURO = 321; // Some european keyboards
{$EXTERNALSYM K_EURO}
// End of keys

  // Enumeration of valid key mods (possibly OR'd together)
  KMOD_NONE = $0000;
{$EXTERNALSYM KMOD_NONE}
  KMOD_LSHIFT = $0001;
{$EXTERNALSYM KMOD_LSHIFT}
  KMOD_RSHIFT = $0002;
{$EXTERNALSYM KMOD_RSHIFT}
  KMOD_LCTRL = $0040;
{$EXTERNALSYM KMOD_LCTRL}
  KMOD_RCTRL = $0080;
{$EXTERNALSYM KMOD_RCTRL}
  KMOD_LALT = $0100;
{$EXTERNALSYM KMOD_LALT}
  KMOD_RALT = $0200;
{$EXTERNALSYM KMOD_RALT}
  KMOD_LMETA = $0400;
{$EXTERNALSYM KMOD_LMETA}
  KMOD_RMETA = $0800;
{$EXTERNALSYM KMOD_RMETA}
  KMOD_NUM = $1000;
{$EXTERNALSYM KMOD_NUM}
  KMOD_CAPS = $2000;
{$EXTERNALSYM KMOD_CAPS}
  KMOD_MODE = 44000;
{$EXTERNALSYM KMOD_MODE}
  KMOD_RESERVED = $8000;
{$EXTERNALSYM KMOD_RESERVED}

  KMOD_CTRL = (KMOD_LCTRL or KMOD_RCTRL);
{$EXTERNALSYM KMOD_CTRL}
  KMOD_SHIFT = (KMOD_LSHIFT or KMOD_RSHIFT);
{$EXTERNALSYM KMOD_SHIFT}
  KMOD_ALT = (KMOD_LALT or KMOD_RALT);
{$EXTERNALSYM KMOD_ALT}
  KMOD_META = (KMOD_LMETA or KMOD_RMETA);
{$EXTERNALSYM KMOD_META}


// And here we go with the mouse buttons
  BUTTON_LEFT      = 1;
{$EXTERNALSYM BUTTON_LEFT}
  BUTTON_MIDDLE    = 2;
{$EXTERNALSYM BUTTON_MIDDLE}
  BUTTON_RIGHT     = 3;
{$EXTERNALSYM BUTTON_RIGHT}
  BUTTON_WHEELUP   = 4;
{$EXTERNALSYM BUTTON_WHEELUP}
  BUTTON_WHEELDOWN = 5;
{$EXTERNALSYM BUTTON_WHEELDOWN}
// End of copying from other units
