]> icculus.org git repositories - taylor/freespace2.git/blob - src/controlconfig/controlsconfigcommon.cpp
SDL2 port - stage 2
[taylor/freespace2.git] / src / controlconfig / controlsconfigcommon.cpp
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell 
5  * or otherwise commercially exploit the source or things you created based on
6  * the source.
7  */
8
9 /*
10  * $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * C module for keyboard, joystick and mouse configuration common stuff (between Fred and FreeSpace)
16  *
17  * $Log$
18  * Revision 1.5  2003/06/03 04:00:39  taylor
19  * Polish language support (Janusz Dziemidowicz)
20  *
21  * Revision 1.4  2003/05/25 02:30:42  taylor
22  * Freespace 1 support
23  *
24  * Revision 1.3  2002/06/09 04:41:15  relnev
25  * added copyright header
26  *
27  * Revision 1.2  2002/05/07 03:16:43  theoddone33
28  * The Great Newline Fix
29  *
30  * Revision 1.1.1.1  2002/05/03 03:28:08  root
31  * Initial import.
32  *
33  * 
34  * 14    11/01/99 3:36p Jefff
35  * had scan code texts for y and z in german swapped
36  * 
37  * 13    11/01/99 2:16p Jefff
38  * minor key name change in german
39  * 
40  * 12    10/29/99 6:10p Jefff
41  * squashed the damned y/z german issues once and for all
42  * 
43  * 11    10/28/99 11:16p Jefff
44  * Changed some german key names.  Made key translations always use the
45  * english table.
46  * 
47  * 10    10/28/99 2:05a Jefff
48  * revised some german key names.  changed some y/z switch stuff.
49  * 
50  * 9     10/25/99 5:39p Jefff
51  * swap init binding for y and z keys in German builds
52  * 
53  * 8     9/01/99 2:56p Jefff
54  * a few control key description changes
55  * 
56  * 7     8/22/99 5:53p Dave
57  * Scoring fixes. Added self destruct key. Put callsigns in the logfile
58  * instead of ship designations for multiplayer players.
59  * 
60  * 6     8/19/99 10:59a Dave
61  * Packet loss detection.
62  * 
63  * 5     8/01/99 12:39p Dave
64  * Added HUD contrast control key (for nebula).
65  * 
66  * 4     7/23/99 2:57p Andsager
67  * fix translate_key_to_index to work with localization
68  * 
69  * 3     11/05/98 4:18p Dave
70  * First run nebula support. Beefed up localization a bit. Removed all
71  * conditional compiles for foreign versions. Modified mission file
72  * format.
73  * 
74  * 2     10/07/98 10:52a Dave
75  * Initial checkin.
76  * 
77  * 1     10/07/98 10:48a Dave
78  * 
79  * 41    6/19/98 3:51p Lawrance
80  * localize control text
81  * 
82  * 40    6/17/98 11:05a Lawrance
83  * localize the control config strings
84  * 
85  * 39    5/24/98 2:28p Hoffoss
86  * Because we never really care about if the left or the right shift or
87  * alt key was used, but rather than either shift or alt was used, made
88  * both map to the left one.  Solves some problems, causes none.
89  * 
90  * 38    5/22/98 11:21a Hoffoss
91  * Added bank when pressed back in.
92  * 
93  * 37    5/15/98 8:37p Lawrance
94  * Add 'equalize recharge rates' and 'target ship that sent last
95  * transmission' key bindings
96  * 
97  * 36    5/13/98 7:15p Hoffoss
98  * Fixed remaining bugs with axis binding.
99  * 
100  * 35    5/13/98 1:17a Hoffoss
101  * Added joystick axes configurability.
102  * 
103  * 34    5/12/98 11:25a Hoffoss
104  * Disabled bank when pressed action.
105  * 
106  * 33    5/09/98 10:48p Lawrance
107  * change text for view bindings
108  * 
109  * 32    5/09/98 4:52p Lawrance
110  * Implement padlock view (up/rear/left/right)
111  * 
112  * 31    4/30/98 9:43p Hoffoss
113  * Added new actions for free look movement which are default bounded to
114  * the hat.
115  * 
116  * 30    4/25/98 1:25p Lawrance
117  * Add time compression keys to key config
118  * 
119  * 29    4/25/98 12:43p Allender
120  * added new shortcut key for attack my subsystem
121  * 
122  * 28    4/18/98 5:00p Dave
123  * Put in observer zoom key. Made mission sync screen more informative.
124  * 
125  * 27    4/17/98 1:24a Lawrance
126  * fix spelling error
127  * 
128  * 26    4/15/98 11:06a Lawrance
129  * fix bug with a multi key showing up in demo, remove obsolete bindings
130  * from demo and full version
131  * 
132  * 25    4/10/98 12:47p Allender
133  * changed working on replay popup.  Don't reference repair in comm menu.
134  * Added Shift-R for repair me
135  * 
136  * 24    4/08/98 11:11a Hoffoss
137  * Fixed some bugs that showed up due to fixing other bugs the other day
138  * with controls.
139  * 
140  * 23    4/07/98 4:06p Lawrance
141  * Change binding next for bomb targeting
142  * 
143  * 22    4/07/98 1:52p Lawrance
144  * fix error in binding text for energy keys 
145  * 
146  * 21    4/06/98 11:17a Hoffoss
147  * Fixed num lock/pause interplay bug.
148  * 
149  * 20    4/01/98 6:46p Lawrance
150  * change text for Alt+J
151  * 
152  * 19    3/31/98 4:15p Hoffoss
153  * Disabled the show objectives action.
154  * 
155  * 18    3/25/98 2:16p Dave
156  * Select random default image for newly created pilots. Fixed several
157  * multi-pause messaging bugs. Begin work on online help for multiplayer
158  * keys.
159  * 
160  * 17    3/19/98 5:04p Dave
161  * Put in support for targeted multiplayer text and voice messaging (all,
162  * friendly, hostile, individual).
163  * 
164  * 16    3/17/98 11:25a Hoffoss
165  * Fixed some of the action's names.
166  * 
167  * 15    3/17/98 10:48a Hoffoss
168  * Allowed a special hack for "bank while pressed" action to use alt and
169  * shift keys standalone.
170  * 
171  * 14    2/28/98 9:47p Lawrance
172  * change some binding text
173  * 
174  * 13    2/28/98 7:02p Lawrance
175  * overhaul on-line help
176  * 
177  * 12    2/26/98 12:33a Lawrance
178  * Added back slew mode,  lots of changes to external and chase views.
179  * 
180  * 11    2/23/98 11:25a Sandeep
181  * added default keys
182  * 
183  * 10    2/22/98 6:27p Lawrance
184  * External mode takes precedence over chase mode.  Fix bug with repair
185  * ships docking in chase mode.
186  * 
187  * 9     2/22/98 12:19p John
188  * Externalized some strings
189  * 
190  * 8     2/02/98 6:59p Lawrance
191  * Adding new targeting keys (bomb, uninspected cargo, new ship, live
192  * turrets).
193  * 
194  * 7     1/27/98 4:24p Allender
195  * moved hotkey selection to F3 instead of X.  Made palette flash
196  * disappear in multiplayer pause menu
197  * 
198  * 6     1/22/98 4:53p Hoffoss
199  * Made training messages/directives display a joystick button in place of
200  * a keypress if there is no keypress bound to the action.
201  * 
202  * 5     1/22/98 4:15p Hoffoss
203  * Added code to allow popup to tell player he needs to bind a key for the
204  * training mission.
205  * 
206  * 4     1/02/98 4:42p Allender
207  * removed unused key bindings from control config list
208  * 
209  * 3     12/30/97 4:47p Allender
210  * work with ignore my target command.  Added new keyboard hotkey.  Made
211  * it work globally
212  * 
213  * 2     12/24/97 3:37p Hoffoss
214  * Moved control config stuff to seperate library to Fred can access it as
215  * well.
216  * 
217  * 1     12/24/97 3:27p Hoffoss
218  * 
219  * 1     12/24/97 11:58a Hoffoss
220  * 
221  * 98    12/22/97 2:15p Hoffoss
222  * Fixed bug where joystick axis lines weren't being displayed.
223  * 
224  * 97    12/16/97 2:44p Hoffoss
225  * Added clear button to control config screen.
226  * 
227  * 96    12/12/97 3:07p Hoffoss
228  * Changed how deleting bindings work.  Each control of an action can be
229  * deleted independently or both at once.
230  * 
231  * 95    12/07/97 2:36p John
232  * Made warp out be Alt+J instead of J
233  * 
234  * 94    12/03/97 4:59p Hoffoss
235  * Added reset sound and change control config sounds around.
236  * 
237  * 93    12/03/97 4:16p Hoffoss
238  * Changed sound stuff used in interface screens for interface purposes.
239  * 
240  * 92    12/01/97 5:25p Hoffoss
241  * Routed interface sound playing through a special function that will
242  * only allow one instance of the sound to play at a time, avoiding
243  * over-mixing problems.
244  * 
245  * 91    12/01/97 3:38p Hoffoss
246  * Changed placement of 'More' indicator.
247  * 
248  * 90    11/25/97 3:49p Hoffoss
249  * Changed subhilighting to happen when mouse is over line, rather than
250  * mouse button down but not up again yet.
251  * 
252  * 89    11/24/97 10:20p Lawrance
253  * Add key 'SDLK_n' to target next ship on monitoring view
254  * 
255  * 88    11/24/97 6:15p Lawrance
256  * fix button scroll problem
257  * 
258  * 87    11/23/97 6:15p Hoffoss
259  * Make exiting the controls config screen save the pilot, so changes keep
260  * even if programs crashes or something.
261  * 
262  * 86    11/21/97 5:57p Hoffoss
263  * Fixed bug where timef type controls weren't checking joystick buttons.
264  * 
265  * 85    11/21/97 4:06p Hoffoss
266  * Fixed bug with enabling of axis are reversed.
267  * 
268  * 84    11/20/97 4:47p Hoffoss
269  * Swapped throttle and rudder, which apparently were backwards.
270  * 
271  * 83    11/20/97 4:00p Lawrance
272  * set z to a valid value
273  * 
274  * 82    11/20/97 3:52p Hoffoss
275  * Made "None" appear if no control is bound to function.
276  * 
277  * 81    11/20/97 2:10p Hoffoss
278  * Added defaults for  joystick buttons 2 and 3.
279  * 
280  * 80    11/20/97 1:08a Lawrance
281  * add support for 'R' key - target closest friendly repair ship
282  * 
283  * 79    11/19/97 8:33p Hoffoss
284  * New controls config screen baby!
285  * 
286  * 78    11/17/97 7:09p Hoffoss
287  * Made chase view control a trigger type.
288  * 
289  * 77    11/17/97 6:40p Lawrance
290  * Changed 'I' key to toggle of extended target info, moved target closest
291  * locked missile to 'L'
292  * 
293  * 76    11/17/97 3:26p Jasen
294  * Adjusted coordinates for the help button .ani location
295  * 
296  * 75    11/16/97 3:51p Hoffoss
297  * Added more button to config screen when scrolling allowed.
298  * 
299  * 74    11/16/97 3:20p Hoffoss
300  * Added various suggestions from the Todolist.
301  * 
302  * 73    11/14/97 4:33p Mike
303  * Change Debug key to backquote (from F11).
304  * Balance a ton of subsystems in ships.tbl.
305  * Change "Heavy Laser" to "Disruptor".
306  * 
307  * 72    11/12/97 2:54p Hoffoss
308  * Made modifiers non-stand alone, added support for red tabs on
309  * conflicts.
310  * 
311  * 71    10/30/97 6:01p Hoffoss
312  * Changed screen to utilize the new text color standards.
313  * 
314  * 70    10/29/97 7:25p Hoffoss
315  * Added crude support for UI button double click checking.
316  * 
317  * 69    10/29/97 6:32p Hoffoss
318  * Changed some interface apperances.
319  * 
320  * 68    10/29/97 4:54p Hoffoss
321  * Changed scan_code_text element for Enter to 'Enter' instead of 'a' with
322  * a caret over it (what's that all about?)
323  * 
324  * 67    10/28/97 10:42a Hoffoss
325  * Fixed handling of continuous controls that have modifiers to the key.
326  * 
327  * 66    10/28/97 10:03a Hoffoss
328  * Fixed bug with continuous type controls not registering if pressed and
329  * released too quickly.  Also some other little changes.
330  * 
331  * 65    10/28/97 12:12a Lawrance
332  * remove unused keys (Alt-H and Alt-F)
333  * 
334  * 64    10/27/97 12:23p Hoffoss
335  * Improved warning system and fixed coloring bug.
336  * 
337  * 63    10/27/97 11:39a Hoffoss
338  * Added control conflicts checking.
339  * 
340  * 62    10/26/97 3:20p Hoffoss
341  * Added many missing features to control config screen.
342  * 
343  * 61    10/25/97 5:41p Hoffoss
344  * More functionality added to the controls config screen.
345  * 
346  * 60    10/24/97 11:00p Hoffoss
347  * Controls config screen much improved.
348  * 
349  * 59    10/22/97 4:50p Hoffoss
350  * Disabled throttle by default.
351  * 
352  * 58    10/22/97 11:00a Hoffoss
353  * Changed VIEW_SLEW and VIEW_EXTERNAL to be continuous rather than
354  * trigger actions.
355  * 
356  * 57    10/21/97 7:05p Hoffoss
357  * Overhauled the key/joystick control structure and usage throughout the
358  * entire FreeSpace code.  The whole system is very different now.
359  * 
360  * 56    10/18/97 7:19p Hoffoss
361  * Added timestamp recording when a key is pressed.
362  * 
363  * 55    10/13/97 4:33p Hoffoss
364  * Made training messages go away after time.
365  * 
366  * 54    10/13/97 3:24p Hoffoss
367  * Made it so training message text can be arbitrarily bolded.
368  * 
369  * 53    9/24/97 4:52p Hoffoss
370  * Changed training message key token handling, and implemented a new
371  * training message system method to test out for a while.
372  * 
373  * 52    9/14/97 10:24p Lawrance
374  * add damage screen popup window
375  * 
376  * 51    9/10/97 6:02p Hoffoss
377  * Added code to check for key-pressed sexp operator in FreeSpace as part
378  * of training mission stuff.
379  * 
380  * 50    9/09/97 3:39p Sandeep
381  * warning level 4 bugs
382  * $NoKeywords: $
383  *
384 */
385
386 #include "controlsconfig.h"
387 #include "key.h"
388 #include "joy.h"
389 #include "localize.h"
390
391 #define TARGET_TAB                      0
392 #define SHIP_TAB                                1
393 #define WEAPON_TAB                      2
394 #define COMPUTER_TAB                    3
395
396 int Failed_key_index;
397
398 // assume control keys are used as modifiers until we find out 
399 int Shift_is_modifier;
400 int Ctrl_is_modifier;
401 int Alt_is_modifier;
402
403 int Axis_enabled[JOY_NUM_AXES] = { 1, 1, 1, 0, 0, 0 };
404 int Axis_enabled_defaults[JOY_NUM_AXES] = { 1, 1, 1, 0, 0, 0 };
405 int Invert_axis[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
406 int Invert_axis_defaults[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
407
408 // arrays which hold the key mappings.  The array index represents a key-independent action.
409 //
410 //XSTR:OFF
411 config_item Control_config[CCFG_MAX + 1] = {
412         // targeting a ship
413         {                           SDLK_t,                             -1, TARGET_TAB, "Target Next Ship", CC_TYPE_TRIGGER, -1, -1, 0 },
414         {             KEY_SHIFTED | SDLK_t,                             -1, TARGET_TAB, "Target Previous Ship", CC_TYPE_TRIGGER, -1, -1, 0 },
415         {                           SDLK_h,                             2,  TARGET_TAB, "Target Next Closest Hostile Ship", CC_TYPE_TRIGGER, -1, -1, 0 },
416         {                  KEY_SHIFTED | SDLK_h,                                -1, TARGET_TAB, "Target Previous Closest Hostile Ship", CC_TYPE_TRIGGER, -1, -1, 0 },
417         { KEY_ALTED |               SDLK_h,                             -1, TARGET_TAB, "Toggle Auto Targeting", CC_TYPE_TRIGGER, -1, -1, 0 },
418         {                           SDLK_f,                             -1, TARGET_TAB, "Target Next Closest Friendly Ship", CC_TYPE_TRIGGER, -1, -1, 0 },
419         {             KEY_SHIFTED | SDLK_f,                             -1, TARGET_TAB, "Target Previous Closest Friendly Ship", CC_TYPE_TRIGGER, -1, -1, 0 },
420         {                           SDLK_y,                             4,  TARGET_TAB, "Target Ship in Reticle", CC_TYPE_TRIGGER, -1, -1, 0 },
421         {                           SDLK_g,                             -1, TARGET_TAB, "Target Target's Nearest Attacker", CC_TYPE_TRIGGER, -1, -1, 0 },
422         { KEY_ALTED     |                                        SDLK_y,                                -1, TARGET_TAB, "Target Last Ship to Send Transmission", CC_TYPE_TRIGGER, -1, -1, 0 },
423         { KEY_ALTED |               SDLK_t,                             -1, TARGET_TAB, "Turn Off Auto-Targeting", CC_TYPE_TRIGGER, -1, -1, 0 },
424
425         // targeting a ship's subsystem
426         {                           SDLK_v,                             -1, TARGET_TAB, "Target Subsystem in Reticle", CC_TYPE_TRIGGER, -1, -1, 0 },
427         {                           SDLK_s,                             -1, TARGET_TAB, "Target Next Subsystem", CC_TYPE_TRIGGER, -1, -1, 0 },
428         {             KEY_SHIFTED | SDLK_s,                             -1, TARGET_TAB, "Target Previous Subsystem", CC_TYPE_TRIGGER, -1, -1, 0 },
429         { KEY_ALTED |               SDLK_s,                             -1, TARGET_TAB, "Turn Off Auto-Targeting of Subsystems", CC_TYPE_TRIGGER, -1, -1, 0 },
430
431         // matching speed
432         {                           SDLK_m,                             -1, COMPUTER_TAB,       "Match Target Speed", CC_TYPE_TRIGGER, -1, -1, 0 },
433         { KEY_ALTED |               SDLK_m,                             -1, COMPUTER_TAB,       "Toggle Auto Speed Matching", CC_TYPE_TRIGGER, -1, -1, 0 },
434
435         // weapons
436         {                           SDLK_LCTRL,                 0,       WEAPON_TAB,    "Fire Primary Weapon", CC_TYPE_CONTINUOUS, -1, -1, 0 },
437         {                           SDLK_SPACE,         1,  WEAPON_TAB, "Fire Secondary Weapon", CC_TYPE_CONTINUOUS, -1, -1, 0 },
438         {                           SDLK_PERIOD,                -1, WEAPON_TAB, "Cycle Forward Primary Weapon", CC_TYPE_TRIGGER, -1, -1, 0 },
439         {                           SDLK_COMMA,                 -1, WEAPON_TAB, "Cycle Backward Primary Weapon", CC_TYPE_TRIGGER, -1, -1, 0 },
440         {                           SDLK_SLASH,         -1, WEAPON_TAB, "Cycle Secondary Weapon Bank", CC_TYPE_TRIGGER, -1, -1, 0 },
441         {             KEY_SHIFTED | SDLK_SLASH,         -1, WEAPON_TAB, "Cycle Secondary Weapon Firing Rate", CC_TYPE_TRIGGER, -1, -1, 0 },
442         {                           SDLK_x,                             3,       WEAPON_TAB,    "Launch Countermeasure", CC_TYPE_TRIGGER, -1, -1, 0 },
443
444         // controls
445         {                           SDLK_a,                             -1, SHIP_TAB,           "Forward Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0 },
446         {                           SDLK_z,                             -1, SHIP_TAB,           "Reverse Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0 },
447         {                           SDLK_KP_7,                  -1, SHIP_TAB,           "Bank Left", CC_TYPE_CONTINUOUS, -1, -1, 0 },
448         {                           SDLK_KP_9,                  -1, SHIP_TAB,           "Bank Right", CC_TYPE_CONTINUOUS, -1, -1, 0 },
449         {                           SDLK_KP_8,                  -1, SHIP_TAB,           "Pitch Forward", CC_TYPE_CONTINUOUS, -1, -1, 0 },
450         {                           SDLK_KP_2,                  -1, SHIP_TAB,           "Pitch Backward", CC_TYPE_CONTINUOUS, -1, -1, 0 },
451         {                           SDLK_KP_4,                  -1, SHIP_TAB,           "Turn Left", CC_TYPE_CONTINUOUS, -1, -1, 0 },
452         {                           SDLK_KP_6,                  -1, SHIP_TAB,           "Turn Right", CC_TYPE_CONTINUOUS, -1, -1, 0 },
453
454         // throttle controls
455         {                           SDLK_BACKSPACE,             -1, SHIP_TAB,           "Set Throttle to Zero", CC_TYPE_TRIGGER, -1, -1, 0 },
456         {                           SDLK_BACKSLASH,                     -1, SHIP_TAB,           "Set Throttle to Max", CC_TYPE_TRIGGER, -1, -1, 0 },
457         {                           SDLK_LEFTBRACKET,           -1, SHIP_TAB,           "Set Throttle to One-Third", CC_TYPE_TRIGGER, -1, -1, 0 },
458         {                           SDLK_RIGHTBRACKET,          -1, SHIP_TAB,           "Set Throttle to Two-Thirds", CC_TYPE_TRIGGER, -1, -1, 0 },
459         {                           SDLK_EQUALS,                        -1, SHIP_TAB,           "Increase Throttle 5 Percent", CC_TYPE_TRIGGER, -1, -1, 0 },
460         {                           SDLK_MINUS,                 -1, SHIP_TAB,           "Decrease Throttle 5 Percent", CC_TYPE_TRIGGER, -1, -1, 0 },
461
462         // squadmate messaging
463         {             KEY_SHIFTED | SDLK_a,                             -1, COMPUTER_TAB,       "Attack My Target", CC_TYPE_TRIGGER, -1, -1, 0 },
464         {             KEY_SHIFTED | SDLK_z,                             -1, COMPUTER_TAB,       "Disarm My Target", CC_TYPE_TRIGGER, -1, -1, 0 },
465         {             KEY_SHIFTED | SDLK_d,                             -1, COMPUTER_TAB,       "Disable My Target", CC_TYPE_TRIGGER, -1, -1, 0 },
466         {             KEY_SHIFTED | SDLK_v,                             -1, COMPUTER_TAB,       "Attack my Subsystem", CC_TYPE_TRIGGER, -1, -1, 0 },
467         {             KEY_SHIFTED | SDLK_x,                             -1, COMPUTER_TAB,       "Capture My Target", CC_TYPE_TRIGGER, -1, -1, 0 },
468         {             KEY_SHIFTED | SDLK_e,                             -1, COMPUTER_TAB,       "Engage Enemy", CC_TYPE_TRIGGER, -1, -1, 0 },
469         {             KEY_SHIFTED | SDLK_w,                             -1, COMPUTER_TAB,       "Form on my Wing", CC_TYPE_TRIGGER, -1, -1, 0 },
470         {             KEY_SHIFTED | SDLK_i,                             -1, COMPUTER_TAB,       "Ignore my Target", CC_TYPE_TRIGGER, -1, -1, 0 },
471         {             KEY_SHIFTED | SDLK_p,                             -1, COMPUTER_TAB,       "Protect my Target", CC_TYPE_TRIGGER, -1, -1, 0 },
472         {             KEY_SHIFTED | SDLK_c,                             -1, COMPUTER_TAB,       "Cover me", CC_TYPE_TRIGGER, -1, -1, 0 },
473         {             KEY_SHIFTED | SDLK_j,                             -1, COMPUTER_TAB,       "Return to base", CC_TYPE_TRIGGER, -1, -1, 0 },
474         {                                 KEY_SHIFTED | SDLK_r,                         -1, COMPUTER_TAB, "Rearm me", CC_TYPE_TRIGGER, -1, -1, 0 },
475
476         {                                                                        SDLK_r,                                6,  TARGET_TAB, "Target Closest Attacking Ship", CC_TYPE_TRIGGER, -1, -1, 0 },
477
478         // Views
479         {                           SDLK_KP_MULTIPLY,   -1, COMPUTER_TAB,       "Chase View", CC_TYPE_TRIGGER, -1, -1, 0 },
480         {                           SDLK_KP_PERIOD,     -1, COMPUTER_TAB,       "External View", CC_TYPE_TRIGGER, -1, -1, 0 },
481         {                           SDLK_KP_ENTER,              -1, COMPUTER_TAB,       "Toggle External Camera Lock", CC_TYPE_TRIGGER, -1, -1, 0 },
482         {                           SDLK_KP_0,                  -1, COMPUTER_TAB,       "Free Look View", CC_TYPE_CONTINUOUS, -1, -1, 0 },
483         {                           SDLK_KP_DIVIDE,     -1, COMPUTER_TAB,       "Current Target View", CC_TYPE_TRIGGER, -1, -1, 0 },
484         {                           SDLK_KP_PLUS,               -1, COMPUTER_TAB,       "Increase View Distance", CC_TYPE_CONTINUOUS, -1, -1, 0 },
485         {                           SDLK_KP_MINUS,              -1, COMPUTER_TAB,       "Decrease View Distance", CC_TYPE_CONTINUOUS, -1, -1, 0 },
486         {                           SDLK_KP_5,                  -1, COMPUTER_TAB,       "Center View", CC_TYPE_CONTINUOUS, -1, -1, 0 },
487         {                                                                        -1,                                    33, COMPUTER_TAB, "View Up", CC_TYPE_CONTINUOUS, -1, -1, 0 },
488         {                                                                        -1,                                    32, COMPUTER_TAB, "View Rear", CC_TYPE_CONTINUOUS, -1, -1, 0 },
489         {                                                                        -1,                                    34, COMPUTER_TAB, "View Left", CC_TYPE_CONTINUOUS, -1, -1, 0 },
490         {                                                                        -1,                                    35, COMPUTER_TAB, "View Right", CC_TYPE_CONTINUOUS, -1, -1, 0 },
491
492         {                           SDLK_QUOTE,         -1, COMPUTER_TAB,       "Cycle Radar Range", CC_TYPE_TRIGGER, -1, -1, 0 },
493         {                           SDLK_c,                             -1, COMPUTER_TAB, "Communications Menu", CC_TYPE_TRIGGER, -1, -1, 0 },
494         {                           -1,                                 -1, -1,                         "Show Objectives", CC_TYPE_TRIGGER, -1, -1, 0 },
495         { KEY_ALTED |               SDLK_j,                             -1, COMPUTER_TAB,       "Enter Subspace (End Mission)", CC_TYPE_TRIGGER, -1, -1, 0 },
496         {                           SDLK_j,                             -1, TARGET_TAB, "Target Target's Target", CC_TYPE_TRIGGER, -1, -1, 0 },
497         {                           SDLK_TAB,                   5,  SHIP_TAB,           "Afterburner", CC_TYPE_CONTINUOUS, -1, -1, 0 },
498         
499         {                           SDLK_INSERT,                -1, COMPUTER_TAB,       "Increase Weapon Energy", CC_TYPE_TRIGGER, -1, -1, 0 },
500         {                           SDLK_DELETE,                -1, COMPUTER_TAB,       "Decrease Weapon Energy", CC_TYPE_TRIGGER, -1, -1, 0 },
501         {                           SDLK_HOME,                  -1, COMPUTER_TAB,       "Increase Shield Energy", CC_TYPE_TRIGGER, -1, -1, 0 },
502         {                           SDLK_END,                   -1, COMPUTER_TAB,       "Decrease Shield Energy", CC_TYPE_TRIGGER, -1, -1, 0 },
503         {                           SDLK_PAGEUP,                -1, COMPUTER_TAB,       "Increase Engine Energy", CC_TYPE_TRIGGER, -1, -1, 0 },
504         {                           SDLK_PAGEDOWN,              -1, COMPUTER_TAB,       "Decrease Engine Energy", CC_TYPE_TRIGGER, -1, -1, 0 },
505         { KEY_ALTED |               SDLK_d,                             -1, COMPUTER_TAB, "Equalize Energy Settings", CC_TYPE_TRIGGER, -1, -1, 0 },
506
507         {                           SDLK_q,                             7,  COMPUTER_TAB,       "Equalize Shield", CC_TYPE_TRIGGER, -1, -1, 0 },
508         {                           SDLK_UP,                            -1, COMPUTER_TAB,       "Augment Forward Shield", CC_TYPE_TRIGGER, -1, -1, 0 },
509         {                           SDLK_DOWN,                  -1, COMPUTER_TAB,       "Augment Rear Shield", CC_TYPE_TRIGGER, -1, -1, 0 },
510         {                           SDLK_LEFT,                  -1, COMPUTER_TAB,       "Augment Left Shield", CC_TYPE_TRIGGER, -1, -1, 0 },
511         {                           SDLK_RIGHT,                 -1, COMPUTER_TAB,       "Augment Right Shield", CC_TYPE_TRIGGER, -1, -1, 0 },
512         {                           SDLK_SCROLLLOCK,    -1, COMPUTER_TAB,       "Transfer Energy Laser->Shield", CC_TYPE_TRIGGER, -1, -1, 0 },
513         {             KEY_SHIFTED | SDLK_SCROLLLOCK,    -1, COMPUTER_TAB,       "Transfer Energy Shield->Laser", CC_TYPE_TRIGGER, -1, -1, 0 },
514         {                           -1,                                 -1, -1,                         "Show Damage Popup Window", CC_TYPE_TRIGGER, -1, -1, 0 },       
515
516         {                           -1,                                 -1, SHIP_TAB,           "Bank When Pressed", CC_TYPE_CONTINUOUS, -1, -1, 0 },
517         {                                                                        -1,                                    -1, -1,                         "Show NavMap", CC_TYPE_TRIGGER, -1, -1, 0 },
518         { KEY_ALTED |                SDLK_e,                            -1, COMPUTER_TAB,       "Add or Remove Escort", CC_TYPE_TRIGGER, -1, -1, 0 },
519         { KEY_ALTED | KEY_SHIFTED | SDLK_e,                             -1, COMPUTER_TAB,       "Clear Escort List", CC_TYPE_TRIGGER, -1, -1, 0 },
520         {                                                    SDLK_e,                            -1, TARGET_TAB, "Target Next Escort Ship", CC_TYPE_TRIGGER, -1, -1, 0 },
521         { KEY_ALTED     |                                        SDLK_r,                                -1, TARGET_TAB, "Target Closest Repair Ship", CC_TYPE_TRIGGER, -1, -1, 0 },
522
523         {                           SDLK_u,                             -1, TARGET_TAB, "Target Next Uninspected Cargo", CC_TYPE_TRIGGER, -1, -1, 0 },
524         {             KEY_SHIFTED | SDLK_u,                             -1, TARGET_TAB, "Target Previous Uninspected Cargo", CC_TYPE_TRIGGER, -1, -1, 0 },
525         {                                                                        SDLK_n,                                -1, TARGET_TAB, "Target Newest Ship In Area", CC_TYPE_TRIGGER, -1, -1, 0 },
526         {                           SDLK_k,                             -1, TARGET_TAB, "Target Next Live Turret", CC_TYPE_TRIGGER, -1, -1, 0 },
527         {             KEY_SHIFTED | SDLK_k,                             -1, TARGET_TAB, "Target Previous Live Turret", CC_TYPE_TRIGGER, -1, -1, 0 },
528
529         {                                                                        SDLK_b,                                -1, TARGET_TAB, "Target Next Hostile Bomb or Bomber", CC_TYPE_TRIGGER, -1, -1, 0 },
530         {             KEY_SHIFTED | SDLK_b,                             -1, TARGET_TAB, "Target Previous Hostile Bomb or Bomber", CC_TYPE_TRIGGER, -1, -1, 0 },
531
532         // multiplayer messaging keys
533         {                                                                        SDLK_1,                                -1, COMPUTER_TAB,       "(Multiplayer) Message All", CC_TYPE_CONTINUOUS, -1, -1, 0 },
534         {                                                                        SDLK_2,                                -1, COMPUTER_TAB, "(Multiplayer) Message Friendly", CC_TYPE_CONTINUOUS, -1, -1, 0 },
535         {                                                                        SDLK_3,                                -1, COMPUTER_TAB, "(Multiplayer) Message Hostile", CC_TYPE_CONTINUOUS, -1, -1, 0 },
536         {                                                                        SDLK_4,                                -1, COMPUTER_TAB, "(Multiplayer) Message Target", CC_TYPE_CONTINUOUS, -1, -1, 0 },
537         { KEY_ALTED     |                                        SDLK_x,                                -1, COMPUTER_TAB, "(Multiplayer) Observer zoom to target", CC_TYPE_TRIGGER, -1, -1, 0 },
538
539         {             KEY_SHIFTED | SDLK_PERIOD,                -1, COMPUTER_TAB,       "Increase time compression", CC_TYPE_TRIGGER, -1, -1, 0 },
540         {             KEY_SHIFTED | SDLK_COMMA,                 -1, COMPUTER_TAB,       "Decrease time compression", CC_TYPE_TRIGGER, -1, -1, 0 },
541
542         {                                                                        SDLK_l,                                -1, COMPUTER_TAB, "Toggle high HUD contrast", CC_TYPE_TRIGGER, -1, -1, 0 },
543
544         {                                 KEY_SHIFTED | SDLK_n,                         -1, COMPUTER_TAB, "(Multiplayer) Toggle network info", CC_TYPE_TRIGGER, -1, -1, 0 },
545         {                                 KEY_SHIFTED | SDLK_END,                       -1, COMPUTER_TAB, "(Multiplayer) Self destruct", CC_TYPE_TRIGGER, -1, -1, 0 },
546
547         {                           -1,                                 -1, -1,                         "", CC_TYPE_TRIGGER, -1, -1, 0 }
548 };
549 /*
550 #ifndef MAKE_FS1
551         "7",                            "8",                            "9",                            "0",                            "Akzent '",                             "\xE1",                         "R\x81""cktaste",               "Tab",
552 #else
553         "7",                            "8",                            "9",                            "0",                            "?",                            "Akzent '",                             "R\x81""cktaste",               "Tab",
554 #endif
555 #ifndef MAKE_FS1
556         "\xAE",                         "`",                            "Shift",                        "#",                            "Y",                            "X",                            "C",                            "V",
557 #else
558         "\x8E",                         "`",                            "Shift",                        "#",                            "Y",                            "X",                            "C",                            "V",
559 #endif
560 */
561 /*
562 const char *Scan_code_text_german[] = {
563         "",                             "Esc",                          "1",                            "2",                            "3",                            "4",                            "5",                            "6",
564         "7",                            "8",                            "9",                            "0",                            "Akzent '",                             "\xE1",                         "R\x81""cktaste",               "Tab",
565         "Q",                            "W",                            "E",                            "R",                            "T",                            "Z",                            "U",                            "I",
566         "O",                            "P",                            "\x9A",                         "+",                            "Eingabe",                      "Strg Links",                   "A",                            "S",
567
568         "D",                            "F",                            "G",                            "H",                            "J",                            "K",                            "L",                            "\x99",
569         "\xAE",                         "`",                            "Shift",                        "#",                            "Y",                            "X",                            "C",                            "V",
570         "B",                            "N",                            "M",                            ",",                            ".",                            "-",                            "Shift",                        "Num *",
571         "Alt",                          "Leertaste",                    "Hochstell",                    "F1",                           "F2",                           "F3",                           "F4",                           "F5",
572
573         "F6",                           "F7",                           "F8",                           "F9",                           "F10",                          "Pause",                        "Rollen",                       "Num 7",
574         "Num 8",                        "Num 9",                        "Num -",                        "Num 4",                        "Num 5",                        "Num 6",                        "Num +",                        "Num 1",
575         "Num 2",                        "Num 3",                        "Num 0",                        "Num ,",                        "",                             "",                             "",                             "F11",
576         "F12",                          "",                             "",                             "",                             "",                             "",                             "",                             "",
577
578         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
579         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
580         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
581         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
582
583         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
584         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
585         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
586         "",                             "",                             "",                             "",                             "Num Eingabe",                  "Strg Rechts",                  "",                             "",
587
588         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
589         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
590         "",                             "",                             "",                             "",                             "",                             "Num /",                        "",                             "Druck",
591         "Alt",                          "",                             "",                             "",                             "",                             "",                             "",                             "",
592
593         "",                             "",                             "",                             "",                             "",                             "Num Lock",                     "",                             "Pos 1",
594         "Pfeil Hoch",                   "Bild Hoch",                    "",                             "Pfeil Links",                  "",                             "Pfeil Rechts",                 "",                             "Ende",
595         "Pfeil Runter",                         "Bild Runter",                  "Einfg",                        "Entf",                         "",                             "",                             "",                             "",
596         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
597
598         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
599         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
600         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
601         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
602 };
603 */
604 const char *Scan_code_text_german[] = {
605         "",     "",     "",     "",     "A",    "B",    "C",    "D",    "E",
606         "F",    "G",    "H",    "I",    "J",    "K",    "L",    "M",
607         "N",    "O",    "P",    "Q",    "R",    "S",    "T",    "U",
608         "V",    "W",    "X",    "Z",    "Y",    "1",    "2",    "3",
609         "4",    "5",    "6",    "7",    "8",    "9",    "0",    "Eingabe",
610         "Esc",  "R\x81""cktaste",       "Tab",  "Leertaste",    "Akzent '",     "\xE1", "\x9A", "+",
611         "#",    "",     "\x99", "\xAE", "`",    ",",    ".",    "-",
612         "Hochstell",    "F1",   "F2",   "F3",   "F4",   "F5",   "F6",   "F7",
613         "F8",   "F9",   "F10",  "F11",  "F12",  "Druck",        "Rollen",       "Pause",
614         "Einfg",        "Pos 1",        "Bild Hoch",    "Entf", "Ende", "Bild Runter",  "Pfeil Rechts", "Pfeil Links",
615         "Pfeil Runter", "Pfeil Hoch",   "",     "Num /",        "Num *",        "Num -",        "Num +",        "Num Eingabe",
616         "Num 1",        "Num 2",        "Num 3",        "Num 4",        "Num 5",        "Num 6",        "Num 7",        "Num 8",
617         "Num 9",        "Num 0",        "Num ,",        "",     "",     "",     "",     "",
618         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
619         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
620         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
621         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
622         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
623         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
624         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
625         "",     "",     "",     "",     "",     "",     "",     "Strg Links",
626         "Shift",        "Alt",  "",     "Strg Rechts",  "Shift",        "Alt",  "",     "",
627         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
628         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
629         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
630         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
631         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
632         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
633         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
634         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
635         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
636         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
637         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
638         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
639         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
640         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
641         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
642         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
643         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
644         "",     "",     "",     "",     "",     "",     ""
645 };
646
647 const char *Joy_button_text_german[] = {
648         "Knopf 1",              "Knopf 2",              "Knopf 3",              "Knopf 4",              "Knopf 5",              "Knopf 6",
649         "Knopf 7",              "Knopf 8",              "Knopf 9",              "Knopf 10",             "Knopf 11",             "Knopf 12",
650         "Knopf 13",             "Knopf 14",             "Knopf 15",             "Knopf 16",             "Knopf 17",             "Knopf 18",
651         "Knopf 19",             "Knopf 20",             "Knopf 21",             "Knopf 22",             "Knopf 23",             "Knopf 24",
652         "Knopf 25",             "Knopf 26",             "Knopf 27",             "Knopf 28",             "Knopf 29",             "Knopf 30",
653         "Knopf 31",             "Knopf 32",             "Hut Hinten",   "Hut Vorne",    "Hut Links",    "Hut Rechts"
654 };
655
656 /*
657 const char *Scan_code_text_french[] = {
658         "",                             "\x90""chap",                   "1",                            "2",                            "3",                            "4",                            "5",                            "6",
659         "7",                            "8",                            "9",                            "0",                            "-",                            "=",                            "Fl\x82""che Ret.",                     "Tab",
660         "Q",                            "W",                            "E",                            "R",                            "T",                            "Y",                            "U",                            "I",
661         "O",                            "P",                            "[",                            "]",                            "Entr\x82""e",                  "Ctrl Gauche",                  "A",                            "S",
662
663         "D",                            "F",                            "G",                            "H",                            "J",                            "K",                            "L",                            ";",
664         "'",                            "`",                            "Maj.",                 "\\",                           "Z",                            "X",                            "C",                            "V",
665         "B",                            "N",                            "M",                            ",",                            ".",                            "/",                            "Maj.",                 "Pav\x82 *",
666         "Alt",                          "Espace",                       "Verr. Maj.",                   "F1",                           "F2",                           "F3",                           "F4",                           "F5",
667
668         "F6",                           "F7",                           "F8",                           "F9",                           "F10",                          "Pause",                        "Arret defil",          "Pav\x82 7",
669         "Pav\x82 8",                    "Pav\x82 9",                    "Pav\x82 -",                    "Pav\x82 4",                    "Pav\x82 5",                    "Pav\x82 6",                    "Pav\x82 +",                    "Pav\x82 1",
670         "Pav\x82 2",                    "Pav\x82 3",                    "Pav\x82 0",                    "Pav\x82 .",                    "",                             "",                             "",                             "F11",
671         "F12",                          "",                             "",                             "",                             "",                             "",                             "",                             "",
672
673         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
674         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
675         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
676         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
677
678         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
679         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
680         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
681         "",                             "",                             "",                             "",                             "Pav\x82 Entr",                 "Ctrl Droite",          "",                             "",
682
683         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
684         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
685         "",                             "",                             "",                             "",                             "",                             "Pav\x82 /",                    "",                             "Impr \x82""cran",
686         "Alt",                          "",                             "",                             "",                             "",                             "",                             "",                             "",
687
688         "",                             "",                             "",                             "",                             "",                             "Verr num",                     "",                             "Orig.",
689         "Fl\x82""che Haut",                     "Page Haut",                    "",                             "Fl\x82""che Gauche",                   "",                             "Fl\x82""che Droite",                   "",                     "Fin",
690         "Fl\x82""che Bas",                      "Page Bas",                     "Inser",                        "Suppr",                        "",                             "",                             "",                             "",
691         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
692
693         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
694         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
695         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
696         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
697 };
698 */
699 const char *Scan_code_text_french[] = {
700         "",     "",     "",     "",     "A",    "B",    "C",    "D",    "E",
701         "F",    "G",    "H",    "I",    "J",    "K",    "L",    "M",
702         "N",    "O",    "P",    "Q",    "R",    "S",    "T",    "U",
703         "V",    "W",    "X",    "Y",    "Z",    "1",    "2",    "3",
704         "4",    "5",    "6",    "7",    "8",    "9",    "0",    "Entr\x82""e",
705         "\x90""chap",   "Fl\x82""che Ret.",     "Tab",  "Espace",       "-",    "=",    "[",    "]",
706         "\\",   "",     ";",    "'",    "`",    ",",    ".",    "/",
707         "Verr. Maj.",   "F1",   "F2",   "F3",   "F4",   "F5",   "F6",   "F7",
708         "F8",   "F9",   "F10",  "F11",  "F12",  "Impr \x82""cran",      "Arret defil",  "Pause",
709         "Inser",        "Orig.",        "Page Haut",    "Suppr",        "Fin",  "Page Bas",     "Fl\x82""che Droite",   "Fl\x82""che Gauche",
710         "Fl\x82""che Bas",      "Fl\x82""che Haut",     "",     "Pav\x82 /",    "Pav\x82 *",    "Pav\x82 -",    "Pav\x82 +",    "Pav\x82 Entr",
711         "Pav\x82 1",    "Pav\x82 2",    "Pav\x82 3",    "Pav\x82 4",    "Pav\x82 5",    "Pav\x82 6",    "Pav\x82 7",    "Pav\x82 8",
712         "Pav\x82 9",    "Pav\x82 0",    "Pav\x82 .",    "",     "",     "",     "",     "",
713         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
714         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
715         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
716         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
717         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
718         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
719         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
720         "",     "",     "",     "",     "",     "",     "",     "Ctrl Gauche",
721         "Maj.", "Alt",  "",     "Ctrl Droite",  "Maj.", "Alt",  "",     "",
722         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
723         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
724         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
725         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
726         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
727         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
728         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
729         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
730         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
731         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
732         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
733         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
734         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
735         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
736         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
737         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
738         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
739         "",     "",     "",     "",     "",     "",     ""
740 };
741
742 const char *Joy_button_text_french[] = {
743         "Bouton 1",             "Bouton 2",             "Bouton 3",             "Bouton 4",             "Bouton 5",             "Bouton 6",
744         "Bouton 7",             "Bouton 8",             "Bouton 9",             "Bouton 10",            "Bouton 11",            "Bouton 12",
745         "Bouton 13",            "Bouton 14",            "Bouton 15",            "Bouton 16",            "Bouton 17",            "Bouton 18",
746         "Bouton 19",            "Bouton 20",            "Bouton 21",            "Bouton 22",            "Bouton 23",            "Bouton 24",
747         "Bouton 25",            "Bouton 26",            "Bouton 27",            "Bouton 28",            "Bouton 29",            "Bouton 30",
748         "Bouton 31",            "Bouton 32",            "Chapeau Arri\xE8re",           "Chapeau Avant",                "Chapeau Gauche",               "Chapeau Droite"
749 };
750
751 //      This is the text that is displayed on the screen for the keys a player selects
752 /*
753 const char *Scan_code_text_english[] = {
754         "",                             "Esc",                  "1",                            "2",                            "3",                            "4",                            "5",                            "6",
755         "7",                            "8",                            "9",                            "0",                            "-",                            "=",                            "Backspace",    "Tab",
756         "Q",                            "W",                            "E",                            "R",                            "T",                            "Y",                            "U",                            "I",
757         "O",                            "P",                            "[",                            "]",                            "Enter",                        "Left Ctrl",    "A",                            "S",
758
759         "D",                            "F",                            "G",                            "H",                            "J",                            "K",                            "L",                            ";",
760         "'",                            "`",                            "Shift",                        "\\",                           "Z",                            "X",                            "C",                            "V",
761         "B",                            "N",                            "M",                            ",",                            ".",                            "/",                            "Shift",                        "Pad *",
762         "Alt",                  "Spacebar",             "Caps Lock",    "F1",                           "F2",                           "F3",                           "F4",                           "F5",
763
764         "F6",                           "F7",                           "F8",                           "F9",                           "F10",                  "Pause",                        "Scroll Lock",  "Pad 7",
765         "Pad 8",                        "Pad 9",                        "Pad -",                        "Pad 4",                        "Pad 5",                        "Pad 6",                        "Pad +",                        "Pad 1",
766         "Pad 2",                        "Pad 3",                        "Pad 0",                        "Pad .",                        "",                             "",                             "",                             "F11",
767         "F12",                  "",                             "",                             "",                             "",                             "",                             "",                             "",
768
769         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
770         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
771         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
772         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
773
774         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
775         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
776         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
777         "",                             "",                             "",                             "",                             "Pad Enter",    "Right Ctrl",   "",                             "",
778
779         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
780         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
781         "",                             "",                             "",                             "",                             "",                             "Pad /",                        "",                             "Print Scrn",
782         "Alt",                  "",                             "",                             "",                             "",                             "",                             "",                             "",
783
784         "",                             "",                             "",                             "",                             "",                             "Num Lock",             "",                             "Home",
785         "Up Arrow",             "Page Up",              "",                             "Left Arrow",   "",                             "Right Arrow",  "",                             "End",
786         "Down Arrow",  "Page Down",     "Insert",               "Delete",               "",                             "",                             "",                             "",
787         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
788
789         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
790         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
791         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
792         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
793 };
794 */
795 const char *Scan_code_text_english[] = {
796         "",     "",     "",     "",     "A",    "B",    "C",    "D",    "E",
797         "F",    "G",    "H",    "I",    "J",    "K",    "L",    "M",
798         "N",    "O",    "P",    "Q",    "R",    "S",    "T",    "U",
799         "V",    "W",    "X",    "Y",    "Z",    "1",    "2",    "3",
800         "4",    "5",    "6",    "7",    "8",    "9",    "0",    "Enter",
801         "Esc",  "Backspace",    "Tab",  "Spacebar",     "-",    "=",    "[",    "]",
802         "\\",   "",     ";",    "'",    "`",    ",",    ".",    "/",
803         "Caps Lock",    "F1",   "F2",   "F3",   "F4",   "F5",   "F6",   "F7",
804         "F8",   "F9",   "F10",  "F11",  "F12",  "Print Scrn",   "Scroll Lock",  "Pause",
805         "Insert",       "Home", "Page Up",      "Delete",       "End",  "Page Down",    "Right Arrow",  "Left Arrow",
806         "Down Arrow",   "Up Arrow",     "",     "Pad /",        "Pad *",        "Pad -",        "Pad +",        "Pad Enter",
807         "Pad 1",        "Pad 2",        "Pad 3",        "Pad 4",        "Pad 5",        "Pad 6",        "Pad 7",        "Pad 8",
808         "Pad 9",        "Pad 0",        "Pad .",        "",     "",     "",     "",     "",
809         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
810         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
811         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
812         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
813         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
814         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
815         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
816         "",     "",     "",     "",     "",     "",     "",     "Left Ctrl",
817         "Shift",        "Alt",  "",     "Right Ctrl",   "Shift",        "Alt",  "",     "",
818         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
819         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
820         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
821         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
822         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
823         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
824         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
825         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
826         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
827         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
828         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
829         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
830         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
831         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
832         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
833         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
834         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
835         "",     "",     "",     "",     "",     "",     ""
836 };
837
838 const char *Joy_button_text_english[] = {
839         "Button 1",             "Button 2",             "Button 3",             "Button 4",             "Button 5",             "Button 6",
840         "Button 7",             "Button 8",             "Button 9",             "Button 10",    "Button 11",    "Button 12",
841         "Button 13",    "Button 14",    "Button 15",    "Button 16",    "Button 17",    "Button 18",
842         "Button 19",    "Button 20",    "Button 21",    "Button 22",    "Button 23",    "Button 24",
843         "Button 25",    "Button 26",    "Button 27",    "Button 28",    "Button 29",    "Button 30",
844         "Button 31",    "Button 32",    "Hat Back",             "Hat Forward",  "Hat Left",             "Hat Right"
845 };
846 /*
847 const char *Scan_code_text_polish[] = {
848         "",                             "Esc",                  "1",                            "2",                            "3",                            "4",                            "5",                            "6",
849         "7",                            "8",                            "9",                            "0",                            "-",                            "=",                            "Backspace",    "Tab",
850         "Q",                            "W",                            "E",                            "R",                            "T",                            "Y",                            "U",                            "I",
851         "O",                            "P",                            "[",                            "]",                            "Enter",                        "Lewy Ctrl",    "A",                            "S",
852
853         "D",                            "F",                            "G",                            "H",                            "J",                            "K",                            "L",                            ";",
854         "'",                            "`",                            "LShift",                       "\\",                           "Z",                            "X",                            "C",                            "V",
855         "B",                            "N",                            "M",                            ",",                            ".",                            "/",                            "PShift",                       "Num *",
856         "Alt",                  "Spacja",               "CapsLock",     "F1",                           "F2",                           "F3",                           "F4",                           "F5",
857
858         "F6",                           "F7",                           "F8",                           "F9",                           "F10",                  "Pause",                        "Scrlock",      "Num 7",
859         "Num 8",                        "Num 9",                        "Num -",                        "Num 4",                        "Num 5",                        "Num 6",                        "Num +",                        "Num 1",
860         "Num 2",                        "Num 3",                        "Num 0",                        "Num .",                        "",                             "",                             "",                             "F11",
861         "F12",                  "",                             "",                             "",                             "",                             "",                             "",                             "",
862
863         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
864         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
865         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
866         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
867
868         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
869         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
870         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
871         "",                             "",                             "",                             "",                             "Num Enter",    "Prawy Ctrl",   "",                             "",
872
873         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
874         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
875         "",                             "",                             "",                             "",                             "",                             "Num /",                        "",                             "PrntScr",
876         "Alt",                  "",                             "",                             "",                             "",                             "",                             "",                             "",
877
878         "",                             "",                             "",                             "",                             "",                             "Num Lock",             "",                             "Home",
879         "Kursor G\xF3ra",               "Page Up",              "",                             "Kursor Lewo",  "",                             "Kursor Prawo", "",                             "End",
880         "Kursor D\xF3\xB3",  "Page Down",       "Insert",               "Delete",               "",                             "",                             "",                             "",
881         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
882
883         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
884         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
885         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
886         "",                             "",                             "",                             "",                             "",                             "",                             "",                             "",
887 };
888 */
889 const char *Scan_code_text_polish[] = {
890         "",     "",     "",     "",     "A",    "B",    "C",    "D",    "E",
891         "F",    "G",    "H",    "I",    "J",    "K",    "L",    "M",
892         "N",    "O",    "P",    "Q",    "R",    "S",    "T",    "U",
893         "V",    "W",    "X",    "Y",    "Z",    "1",    "2",    "3",
894         "4",    "5",    "6",    "7",    "8",    "9",    "0",    "Enter",
895         "Esc",  "Backspace",    "Tab",  "Spacja",       "-",    "=",    "[",    "]",
896         "\\",   "",     ";",    "'",    "`",    ",",    ".",    "/",
897         "CapsLock",     "F1",   "F2",   "F3",   "F4",   "F5",   "F6",   "F7",
898         "F8",   "F9",   "F10",  "F11",  "F12",  "PrntScr",      "Scrlock",      "Pause",
899         "Insert",       "Home", "Page Up",      "Delete",       "End",  "Page Down",    "Kursor Prawo", "Kursor Lewo",
900         "Kursor D\xF3\xB3",     "Kursor G\xF3ra",       "",     "Num /",        "Num *",        "Num -",        "Num +",        "Num Enter",
901         "Num 1",        "Num 2",        "Num 3",        "Num 4",        "Num 5",        "Num 6",        "Num 7",        "Num 8",
902         "Num 9",        "Num 0",        "Num .",        "",     "",     "",     "",     "",
903         "",     "",     "",     "",     "",     "",     "",     "", "", "",     "",     "",     "",     "",     "",     "",
904         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
905         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
906         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
907         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
908         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
909         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
910         "",     "",     "",     "",     "",     "",     "",     "Lewy Ctrl",
911         "LShift",       "Alt",  "",     "Prawy Ctrl",   "PShift",       "Alt",  "",     "",
912         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
913         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
914         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
915         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
916         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
917         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
918         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
919         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
920         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
921         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
922         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
923         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
924         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
925         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
926         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
927         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
928         "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",     "",
929         "",     "",     "",     "",     "",     "",     ""
930 };
931
932 const char *Joy_button_text_polish[] = {
933         "Przyc.1",              "Przyc.2",              "Przyc.3",              "Przyc.4",              "Przyc.5",              "Przyc.6",
934         "Przyc.7",              "Przyc.8",              "Przyc.9",              "Przyc.10",     "Przyc.11",     "Przyc.12",
935         "Przyc.13",     "Przyc.14",     "Przyc.15",     "Przyc.16",     "Przyc.17",     "Przyc.18",
936         "Przyc.19",     "Przyc.20",     "Przyc.21",     "Przyc.22",     "Przyc.23",     "Przyc.24",
937         "Przyc.25",     "Przyc.26",     "Przyc.27",     "Przyc.28",     "Przyc.29",     "Przyc.30",
938         "Przyc.31",     "Przyc.32",     "Hat Ty\xB3",           "Hat Prz\xF3\x64",      "Hat Lewo",             "Hat Prawo"
939 };
940
941 const char **Scan_code_text = Scan_code_text_english;
942 const char **Joy_button_text = Joy_button_text_english;
943
944
945 void set_modifier_status()
946 {
947         int i;
948
949         Alt_is_modifier = 0;
950         Shift_is_modifier = 0;
951         Ctrl_is_modifier = 0;
952
953         for (i=0; i<CCFG_MAX; i++) {
954                 if (Control_config[i].key_id < 0)
955                         continue;
956
957                 if (Control_config[i].key_id & KEY_ALTED)
958                         Alt_is_modifier = 1;
959
960                 if (Control_config[i].key_id & KEY_SHIFTED)
961                         Shift_is_modifier = 1;
962
963                 if (Control_config[i].key_id & KEY_CTRLED) {
964                         Assert(0);  // get Alan
965                         Ctrl_is_modifier = 1;
966                 }
967         }
968 }
969
970 int translate_key_to_index(const char *key)
971 {
972         int i, index = -1, alt = 0, shift = 0, max_scan_codes;
973
974         if (Lcl_gr) {
975                 max_scan_codes = sizeof(Scan_code_text_german) / sizeof(char *);
976         } else if (Lcl_fr) {
977                 max_scan_codes = sizeof(Scan_code_text_french) / sizeof(char *);
978         } else if (Lcl_pl) {
979                 max_scan_codes = sizeof(Scan_code_text_polish) / sizeof(char *);
980         } else {
981                 max_scan_codes = sizeof(Scan_code_text_english) / sizeof(char *);
982         }
983
984         // look for modifiers
985         Assert(key);
986         if (!strnicmp(key, "Alt", 3)) {
987                 alt = 1;
988                 key += 3;
989                 if (*key)
990                         key++;
991         }
992
993         const char *translated_shift;
994         
995         if(Lcl_gr){
996                 translated_shift = "Shift";
997         } else if(Lcl_fr){      
998                 translated_shift = "Maj.";
999         } else {        
1000                 translated_shift = "Shift";
1001         }
1002
1003         if (!strnicmp(key, translated_shift, 5)) {
1004                 shift = 1;
1005                 key += 5;
1006                 if (*key)
1007                         key++;
1008         }
1009
1010 #ifdef MAKE_FS1
1011         // fix for German training mission key check
1012         if (Lcl_gr && !strcmp(key, "Links Ctrl")) {
1013                 key = "Left Ctrl";
1014         }
1015 #endif
1016
1017         // look up index for default key
1018         if (*key) {
1019                 for (i=0; i<max_scan_codes; i++)
1020                         if (!stricmp(key, Scan_code_text_english[i])) {
1021                                 index = i;
1022                                 break;
1023                         }
1024
1025                 if (i == max_scan_codes)
1026                         return -1;
1027
1028                 if (shift)
1029                         index |= KEY_SHIFTED;
1030                 if (alt)
1031                         index |= KEY_ALTED;
1032
1033                 // convert scancode to Control_config index
1034                 for (i=0; i<CCFG_MAX; i++) {
1035                         if (Control_config[i].key_default == index) {
1036                                 index = i;
1037                                 break;
1038                         }
1039                 }
1040
1041                 if (i == CCFG_MAX)
1042                         return -1;
1043
1044                 return index;
1045         }
1046
1047         return -1;
1048 }
1049
1050 // Given the system default key 'key', return the current key that is bound to the function
1051 // Both are 'key' and the return value are descriptive strings that can be displayed
1052 // directly to the user.  If 'key' isn't a real key or not normally bound to anything,
1053 // or there is no key current bound to the function, NULL is returned.
1054 const char *translate_key(const char *key)
1055 {
1056         int index = -1, code = -1;
1057
1058         index = translate_key_to_index(key);
1059         if (index < 0)
1060                 return NULL;
1061
1062         code = Control_config[index].key_id;
1063         Failed_key_index = index;
1064         if (code < 0) {
1065                 code = Control_config[index].joy_id;
1066                 if (code >= 0)
1067                         return Joy_button_text[code];
1068         }
1069
1070         return textify_scancode(code);
1071 }
1072
1073 const char *textify_scancode(int code)
1074 {
1075         static char text[40];
1076
1077         if (code < 0)
1078                 return "None";
1079
1080         *text = 0;
1081         if (code & KEY_ALTED) {
1082                 if(Lcl_gr){             
1083                         strcat(text, "Alt-");
1084                 } else if(Lcl_fr){              
1085                         strcat(text, "Alt-");
1086                 } else {                
1087                         strcat(text, "Alt-");
1088                 }               
1089         }
1090
1091         if (code & KEY_SHIFTED) {               
1092                 if(Lcl_gr){
1093                         strcat(text, "Shift-");
1094                 } else if(Lcl_fr){              
1095                         strcat(text, "Maj.-");
1096                 } else {                
1097                         strcat(text, "Shift-");
1098                 }
1099         }
1100
1101         code = SDL_GetScancodeFromKey(code & KEY_MASK);
1102
1103         strcat(text, Scan_code_text[code]);
1104         return text;
1105 }
1106 //XSTR:ON
1107
1108 // initialize common control config stuff - call at game startup after localization has been initialized
1109 void control_config_common_init()
1110 {
1111         if(Lcl_gr){
1112                 Scan_code_text = Scan_code_text_german;
1113                 Joy_button_text = Joy_button_text_german;
1114                 
1115                 // swap init bindings for y and z keys
1116         //      Control_config[TARGET_SHIP_IN_RETICLE].key_default = SDLK_z;
1117         //      Control_config[TARGET_LAST_TRANMISSION_SENDER].key_default = KEY_ALTED | SDLK_z;
1118         //      Control_config[REVERSE_THRUST].key_default = SDLK_y;
1119         //      Control_config[DISARM_MESSAGE].key_default = KEY_SHIFTED | SDLK_y;
1120         } else if(Lcl_fr){
1121                 Scan_code_text = Scan_code_text_french;
1122                 Joy_button_text = Joy_button_text_french;
1123         } else if(Lcl_pl){
1124                 Scan_code_text = Scan_code_text_polish;
1125                 Joy_button_text = Joy_button_text_polish;
1126         } else {
1127                 Scan_code_text = Scan_code_text_english;
1128                 Joy_button_text = Joy_button_text_english;
1129         }
1130 }