hedgewars/uKeyNames.pas
author Wuzzy <Wuzzy2@mail.ru>
Thu, 25 Apr 2019 23:01:05 +0200
changeset 14844 e239378a9400
parent 14837 769189675b6c
child 14848 9f6b650a6812
permissions -rw-r--r--
Prevent entering “/”, “\” and “:” in team and scheme names. The name of teams and schems is saved in the file name itself, so these characters would cause trouble as they are used in path names in Linux and Windows.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14837
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     1
(*
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     2
 * Hedgewars, a free turn based strategy game
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     3
 * Copyright (c) 2004-2019 Andrey Korotaev <unC0Rr@gmail.com>
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     4
 *
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     8
 *
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    12
 * GNU General Public License for more details.
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    13
 *
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    17
 *)
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    18
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    19
unit uKeyNames;
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    20
interface
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    21
uses uConsts;
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    22
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    23
type TKeyNames = array [0..cKeyMaxIndex] of string[15];
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    24
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    25
procedure populateKeyNames(var KeyArray: TKeyNames);
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    26
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    27
implementation
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    28
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    29
procedure populateKeyNames(var KeyArray: TKeyNames);
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    30
begin
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    31
(*
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    32
 This is a mapping from SDL scancodes to Hedgewars key identifiers.
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    33
 Hedgewars key identifiers are strings with a maximum length of 15
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    34
 and are used internally to identify keys in the engine and in settings.ini.
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    35
*)
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    36
    KeyArray[4] := 'a';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    37
    KeyArray[5] := 'b';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    38
    KeyArray[6] := 'c';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    39
    KeyArray[7] := 'd';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    40
    KeyArray[8] := 'e';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    41
    KeyArray[9] := 'f';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    42
    KeyArray[10] := 'g';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    43
    KeyArray[11] := 'h';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    44
    KeyArray[12] := 'i';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    45
    KeyArray[13] := 'j';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    46
    KeyArray[14] := 'k';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    47
    KeyArray[15] := 'l';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    48
    KeyArray[16] := 'm';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    49
    KeyArray[17] := 'n';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    50
    KeyArray[18] := 'o';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    51
    KeyArray[19] := 'p';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    52
    KeyArray[20] := 'q';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    53
    KeyArray[21] := 'r';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    54
    KeyArray[22] := 's';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    55
    KeyArray[23] := 't';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    56
    KeyArray[24] := 'u';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    57
    KeyArray[25] := 'v';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    58
    KeyArray[26] := 'w';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    59
    KeyArray[27] := 'x';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    60
    KeyArray[28] := 'y';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    61
    KeyArray[29] := 'z';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    62
    KeyArray[30] := '1';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    63
    KeyArray[31] := '2';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    64
    KeyArray[32] := '3';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    65
    KeyArray[33] := '4';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    66
    KeyArray[34] := '5';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    67
    KeyArray[35] := '6';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    68
    KeyArray[36] := '7';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    69
    KeyArray[37] := '8';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    70
    KeyArray[38] := '9';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    71
    KeyArray[39] := '0';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    72
    KeyArray[40] := 'return';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    73
    KeyArray[41] := 'escape';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    74
    KeyArray[42] := 'backspace';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    75
    KeyArray[43] := 'tab';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    76
    KeyArray[44] := 'space';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    77
    KeyArray[45] := '-';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    78
    KeyArray[46] := '=';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    79
    KeyArray[47] := '[';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    80
    KeyArray[48] := ']';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    81
    KeyArray[49] := '\';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    82
    KeyArray[50] := '#';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    83
    KeyArray[51] := ';';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    84
    KeyArray[52] := '''';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    85
    KeyArray[53] := '`';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    86
    KeyArray[54] := ',';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    87
    KeyArray[55] := '.';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    88
    KeyArray[56] := '/';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    89
    KeyArray[57] := 'capslock';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    90
    KeyArray[58] := 'f1';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    91
    KeyArray[59] := 'f2';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    92
    KeyArray[60] := 'f3';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    93
    KeyArray[61] := 'f4';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    94
    KeyArray[62] := 'f5';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    95
    KeyArray[63] := 'f6';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    96
    KeyArray[64] := 'f7';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    97
    KeyArray[65] := 'f8';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    98
    KeyArray[66] := 'f9';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    99
    KeyArray[67] := 'f10';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   100
    KeyArray[68] := 'f11';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   101
    KeyArray[69] := 'f12';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   102
    KeyArray[70] := 'printscreen';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   103
    KeyArray[71] := 'scrolllock';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   104
    KeyArray[72] := 'pause';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   105
    KeyArray[73] := 'insert';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   106
    KeyArray[74] := 'home';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   107
    KeyArray[75] := 'pageup';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   108
    KeyArray[76] := 'delete';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   109
    KeyArray[77] := 'end';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   110
    KeyArray[78] := 'pagedown';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   111
    KeyArray[79] := 'right';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   112
    KeyArray[80] := 'left';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   113
    KeyArray[81] := 'down';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   114
    KeyArray[82] := 'up';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   115
    KeyArray[83] := 'numlock';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   116
    KeyArray[84] := 'keypad_/';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   117
    KeyArray[85] := 'keypad_*';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   118
    KeyArray[86] := 'keypad_-';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   119
    KeyArray[87] := 'keypad_+';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   120
    KeyArray[88] := 'keypad_enter';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   121
    KeyArray[89] := 'keypad_1';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   122
    KeyArray[90] := 'keypad_2';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   123
    KeyArray[91] := 'keypad_3';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   124
    KeyArray[92] := 'keypad_4';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   125
    KeyArray[93] := 'keypad_5';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   126
    KeyArray[94] := 'keypad_6';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   127
    KeyArray[95] := 'keypad_7';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   128
    KeyArray[96] := 'keypad_8';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   129
    KeyArray[97] := 'keypad_9';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   130
    KeyArray[98] := 'keypad_0';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   131
    KeyArray[99] := 'keypad_.';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   132
    KeyArray[101] := 'menu';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   133
    KeyArray[102] := 'power';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   134
    KeyArray[103] := 'keypad_=';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   135
    KeyArray[104] := 'f13';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   136
    KeyArray[105] := 'f14';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   137
    KeyArray[106] := 'f15';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   138
    KeyArray[107] := 'f16';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   139
    KeyArray[108] := 'f17';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   140
    KeyArray[109] := 'f18';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   141
    KeyArray[110] := 'f19';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   142
    KeyArray[111] := 'f20';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   143
    KeyArray[112] := 'f21';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   144
    KeyArray[113] := 'f22';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   145
    KeyArray[114] := 'f23';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   146
    KeyArray[115] := 'f24';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   147
    KeyArray[116] := 'execute';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   148
    KeyArray[117] := 'help';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   149
    KeyArray[118] := 'menu';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   150
    KeyArray[119] := 'select';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   151
    KeyArray[120] := 'stop';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   152
    KeyArray[121] := 'again';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   153
    KeyArray[122] := 'undo';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   154
    KeyArray[123] := 'cut';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   155
    KeyArray[124] := 'copy';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   156
    KeyArray[125] := 'paste';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   157
    KeyArray[126] := 'find';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   158
    KeyArray[127] := 'mute';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   159
    KeyArray[128] := 'volumeup';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   160
    KeyArray[129] := 'volumedown';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   161
    KeyArray[133] := 'keypad_,';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   162
    KeyArray[134] := 'keypad_=_(as400';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   163
    KeyArray[153] := 'alterase';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   164
    KeyArray[154] := 'sysreq';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   165
    KeyArray[155] := 'cancel';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   166
    KeyArray[156] := 'clear';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   167
    KeyArray[157] := 'prior';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   168
    KeyArray[158] := 'return2';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   169
    KeyArray[159] := 'separator';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   170
    KeyArray[160] := 'out';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   171
    KeyArray[161] := 'oper';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   172
    KeyArray[162] := 'clear_/_again';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   173
    KeyArray[163] := 'crsel';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   174
    KeyArray[164] := 'exsel';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   175
    KeyArray[176] := 'keypad_00';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   176
    KeyArray[177] := 'keypad_000';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   177
    KeyArray[178] := 'thousandssepara';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   178
    KeyArray[179] := 'decimalseparato';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   179
    KeyArray[180] := 'currencyunit';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   180
    KeyArray[181] := 'currencysubunit';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   181
    KeyArray[182] := 'keypad_(';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   182
    KeyArray[183] := 'keypad_)';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   183
    KeyArray[184] := 'keypad_{';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   184
    KeyArray[185] := 'keypad_}';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   185
    KeyArray[186] := 'keypad_tab';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   186
    KeyArray[187] := 'keypad_backspac';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   187
    KeyArray[188] := 'keypad_a';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   188
    KeyArray[189] := 'keypad_b';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   189
    KeyArray[190] := 'keypad_c';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   190
    KeyArray[191] := 'keypad_d';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   191
    KeyArray[192] := 'keypad_e';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   192
    KeyArray[193] := 'keypad_f';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   193
    KeyArray[194] := 'keypad_xor';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   194
    KeyArray[195] := 'keypad_^';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   195
    KeyArray[196] := 'keypad_%';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   196
    KeyArray[197] := 'keypad_<';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   197
    KeyArray[198] := 'keypad_>';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   198
    KeyArray[199] := 'keypad_&';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   199
    KeyArray[200] := 'keypad_&&';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   200
    KeyArray[201] := 'keypad_|';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   201
    KeyArray[202] := 'keypad_||';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   202
    KeyArray[203] := 'keypad_:';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   203
    KeyArray[204] := 'keypad_#';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   204
    KeyArray[205] := 'keypad_space';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   205
    KeyArray[206] := 'keypad_@';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   206
    KeyArray[207] := 'keypad_!';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   207
    KeyArray[208] := 'keypad_memstore';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   208
    KeyArray[209] := 'keypad_memrecal';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   209
    KeyArray[210] := 'keypad_memclear';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   210
    KeyArray[211] := 'keypad_memadd';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   211
    KeyArray[212] := 'keypad_memsubtr';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   212
    KeyArray[213] := 'keypad_memmulti';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   213
    KeyArray[214] := 'keypad_memdivid';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   214
    KeyArray[215] := 'keypad_+/-';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   215
    KeyArray[216] := 'keypad_clear';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   216
    KeyArray[217] := 'keypad_clearent';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   217
    KeyArray[218] := 'keypad_binary';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   218
    KeyArray[219] := 'keypad_octal';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   219
    KeyArray[220] := 'keypad_decimal';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   220
    KeyArray[221] := 'keypad_hexadeci';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   221
    KeyArray[224] := 'left_ctrl';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   222
    KeyArray[225] := 'left_shift';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   223
    KeyArray[226] := 'left_alt';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   224
    KeyArray[227] := 'left_gui';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   225
    KeyArray[228] := 'right_ctrl';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   226
    KeyArray[229] := 'right_shift';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   227
    KeyArray[230] := 'right_alt';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   228
    KeyArray[231] := 'right_gui';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   229
    KeyArray[257] := 'modeswitch';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   230
    KeyArray[258] := 'audionext';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   231
    KeyArray[259] := 'audioprev';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   232
    KeyArray[260] := 'audiostop';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   233
    KeyArray[261] := 'audioplay';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   234
    KeyArray[262] := 'audiomute';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   235
    KeyArray[263] := 'mediaselect';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   236
    KeyArray[264] := 'www';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   237
    KeyArray[265] := 'mail';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   238
    KeyArray[266] := 'calculator';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   239
    KeyArray[267] := 'computer';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   240
    KeyArray[268] := 'ac_search';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   241
    KeyArray[269] := 'ac_home';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   242
    KeyArray[270] := 'ac_back';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   243
    KeyArray[271] := 'ac_forward';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   244
    KeyArray[272] := 'ac_stop';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   245
    KeyArray[273] := 'ac_refresh';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   246
    KeyArray[274] := 'ac_bookmarks';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   247
    KeyArray[275] := 'brightnessdown';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   248
    KeyArray[276] := 'brightnessup';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   249
    KeyArray[277] := 'displayswitch';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   250
    KeyArray[278] := 'kbdillumtoggle';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   251
    KeyArray[279] := 'kbdillumdown';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   252
    KeyArray[280] := 'kbdillumup';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   253
    KeyArray[281] := 'eject';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   254
    KeyArray[282] := 'sleep';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   255
    KeyArray[283] := 'app1';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   256
    KeyArray[284] := 'app2';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   257
    KeyArray[285] := 'audiorewind';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   258
    KeyArray[286] := 'audiofastforwar';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   259
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   260
end;
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   261
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   262
(*
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   263
The Hedgewars key identifiers were obtained with the following algorithm:
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   264
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   265
Basically:
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   266
- For each SDL scancode, do:
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   267
   - Take the printable SDL scancode key name (with SDL_GetScancodeName)
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   268
   - Replace spaces with underscores
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   269
   - Lowercase it
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   270
   - Cap string length to 15 characters
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   271
- Manually fix duplicates
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   272
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   273
See also:
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   274
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   275
https://wiki.libsdl.org/SDLScancodeLookup
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   276
https://wiki.libsdl.org/SDL_Scancode
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   277
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   278
NOTE: For compability reasons, existing identifiers should not be renamed.
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   279
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   280
Old code snippet:
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   281
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   282
    for i := 0 to cKeyMaxIndex - 5 do
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   283
        begin
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   284
        s := shortstring(SDL_GetScancodeName(TSDL_Scancode(i)));
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   285
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   286
        for t := 1 to Length(s) do
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   287
            if s[t] = ' ' then
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   288
                s[t] := '_';
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   289
        KeyArray[i] := LowerCase(s);
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   290
        if s = '''' then
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   291
            WriteLnToConsole('    KeyArray['+IntToStr(i)+']'+' := '';')
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   292
        else if s <> '' then
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   293
            WriteLnToConsole('    KeyArray[SDL_SCANCODE_'+KeyArray[i]+']'+' := '''+KeyArray[i]+''';');
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   294
        end;
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   295
*)
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   296
769189675b6c Add lookup table for Hedgewars key IDs instead of generating IDs on the fly
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   297
end.