]> git.mxchange.org Git - flightgear.git/blob - src/Input/input.cxx
- /sim/model/h-rotation renamed to /sim/model/heading-offset-deg
[flightgear.git] / src / Input / input.cxx
1 // input.cxx -- handle user input from various sources.
2 //
3 // Written by David Megginson, started May 2001.
4 //
5 // Copyright (C) 2001 David Megginson, david@megginson.com
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22
23 #ifdef HAVE_CONFIG_H
24 #  include <config.h>
25 #endif
26
27 #ifdef HAVE_WINDOWS_H
28 #  include <windows.h>                     
29 #endif
30
31 #include <simgear/compiler.h>
32
33 #include <math.h>
34 #include <ctype.h>
35
36 #include STL_FSTREAM
37 #include STL_STRING
38 #include <vector>
39
40 #include <GL/glut.h>
41
42 #include <plib/pu.h>
43
44 #include <simgear/compiler.h>
45
46 #include <simgear/constants.h>
47 #include <simgear/debug/logstream.hxx>
48 #include <simgear/misc/props.hxx>
49
50 #include <Aircraft/aircraft.hxx>
51 #include <Autopilot/auto_gui.hxx>
52 #include <Autopilot/newauto.hxx>
53 #include <Cockpit/hud.hxx>
54 #include <Cockpit/panel.hxx>
55 #include <Cockpit/panel_io.hxx>
56 #include <GUI/gui.h>
57
58 #ifndef FG_OLD_WEATHER
59 #  include <WeatherCM/FGLocalWeatherDatabase.h>
60 #else
61 #  include <Weather/weather.hxx>
62 #endif
63
64 #include <Main/globals.hxx>
65 #include <Main/fg_props.hxx>
66 #include <Main/options.hxx>
67
68 #include "input.hxx"
69
70 #if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
71 SG_USING_STD(ifstream);
72 #endif
73 SG_USING_STD(string);
74 SG_USING_STD(vector);
75
76
77 \f
78 ////////////////////////////////////////////////////////////////////////
79 // Local data structures.
80 ////////////////////////////////////////////////////////////////////////
81
82 \f
83 ////////////////////////////////////////////////////////////////////////
84 // Implementation of FGBinding.
85 ////////////////////////////////////////////////////////////////////////
86
87 FGBinding::FGBinding ()
88   : _command(0),
89     _arg(new SGPropertyNode),
90     _setting(0),
91     _command_state(0)
92 {
93 }
94
95 FGBinding::FGBinding (const FGBinding &binding)
96   : _command_name(binding._command_name),
97     _command(binding._command),
98     _arg(new SGPropertyNode),
99     _setting(0),
100     _command_state(0)
101 {
102   copyProperties(binding._arg, _arg);
103 }
104
105 FGBinding::FGBinding (const SGPropertyNode * node)
106   : _command(0),
107     _arg(new SGPropertyNode),
108     _setting(0),
109     _command_state(0)
110 {
111   read(node);
112 }
113
114 FGBinding::~FGBinding ()
115 {
116   delete _arg;                  // Delete the saved arguments
117   delete _command_state;        // Delete the saved command state
118 }
119
120 void
121 FGBinding::read (const SGPropertyNode * node)
122 {
123   _command_name = node->getStringValue("command", "");
124   if (_command_name == "") {
125     SG_LOG(SG_INPUT, SG_ALERT, "No command supplied for binding.");
126     _command = 0;
127     return;
128   }
129
130   _command = globals->get_commands()->getCommand(_command_name);
131   if (_command == 0) {
132     SG_LOG(SG_INPUT, SG_ALERT, "Command " << _command_name << " is undefined");
133     _arg = 0;
134     return;
135   }
136
137   delete _arg;
138   _arg = new SGPropertyNode;
139   _setting = 0;
140   copyProperties(node, _arg);  // FIXME: don't use whole node!!!
141 }
142
143 void
144 FGBinding::fire () const
145 {
146   if (_command == 0) {
147     SG_LOG(SG_INPUT, SG_ALERT, "No command attached to binding");
148   } else if (!(*_command)(_arg, &_command_state)) {
149     SG_LOG(SG_INPUT, SG_ALERT, "Failed to execute command " << _command_name);
150   }
151 }
152
153 void
154 FGBinding::fire (double setting) const
155 {
156                                 // A value is automatically added to
157                                 // the args
158   if (_setting == 0)            // save the setting node for efficiency
159     _setting = _arg->getChild("setting", 0, true);
160   _setting->setDoubleValue(setting);
161   fire();
162 }
163
164
165 \f
166 ////////////////////////////////////////////////////////////////////////
167 // Implementation of FGInput.
168 ////////////////////////////////////////////////////////////////////////
169
170                                 // From main.cxx
171 extern void fgReshape( int width, int height );
172
173 FGInput current_input;
174
175
176 FGInput::FGInput ()
177 {
178   // no op
179 }
180
181 FGInput::~FGInput ()
182 {
183   // no op
184 }
185
186 void
187 FGInput::init ()
188 {
189   _init_keyboard();
190   _init_joystick();
191 }
192
193 void
194 FGInput::bind ()
195 {
196   // no op
197 }
198
199 void
200 FGInput::unbind ()
201 {
202   // no op
203 }
204
205 void 
206 FGInput::update ()
207 {
208   _update_keyboard();
209   _update_joystick();
210 }
211
212 void
213 FGInput::doKey (int k, int modifiers, int x, int y)
214 {
215   SG_LOG(SG_INPUT, SG_INFO, "User pressed key " << k
216          << " with modifiers " << modifiers);
217
218                                 // Sanity check.
219   if (k < 0 || k >= MAX_KEYS) {
220     SG_LOG(SG_INPUT, SG_ALERT, "Key value " << k << " out of range");
221     return;
222   }
223
224   button &b = _key_bindings[k];
225
226                                 // Key pressed.
227   if (modifiers&FG_MOD_UP == 0) {
228     // SG_LOG( SG_INPUT, SG_INFO, "User pressed key " << k
229     //         << " with modifiers " << modifiers );
230     if (!b.last_state || b.is_repeatable) {
231       const binding_list_t &bindings =
232         _find_key_bindings(k, modifiers);
233       int max = bindings.size();
234       if (max > 0) {
235         for (int i = 0; i < max; i++)
236           bindings[i].fire();
237         return;
238       }
239     }
240   }
241
242                                 // Key released.
243   else {
244     // SG_LOG(SG_INPUT, SG_INFO, "User released key " << k
245     //        << " with modifiers " << modifiers);
246     if (b.last_state) {
247       const binding_list_t &bindings =
248         _find_key_bindings(k, modifiers);
249       int max = bindings.size();
250       if (max > 0) {
251         for (int i = 0; i < max; i++)
252           bindings[i].fire();
253         return;
254       }
255     }
256   }
257
258
259                                 // Use the old, default actions.
260   SG_LOG(SG_INPUT, SG_INFO, "(No user binding.)");
261   if (modifiers&FG_MOD_UP)
262     return;
263
264   // float fov, tmp;
265   static bool winding_ccw = true;
266   // int speed;
267   // FGInterface *f = current_aircraft.fdm_state;
268   // FGViewer *v = globals->get_current_view();
269   
270   // everything after here will be removed sooner or later...
271
272   if (modifiers & FG_MOD_SHIFT) {
273
274         switch (k) {
275         case 18: // Ctrl-R key
276             // temporary
277             winding_ccw = !winding_ccw;
278             if ( winding_ccw ) {
279                 glFrontFace ( GL_CCW );
280             } else {
281                 glFrontFace ( GL_CW );
282             }
283             return;
284         case 72: // H key
285             HUD_brightkey( true );
286             return;
287         case 73: // I key
288             // Minimal Hud
289             fgHUDInit2(&current_aircraft);
290             return;
291         case 87: // W key
292 #if defined(FX) && !defined(WIN32)
293             global_fullscreen = ( !global_fullscreen );
294 #  if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW)
295             XMesaSetFXmode( global_fullscreen ? 
296                             XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW );
297 #  endif
298 #endif
299             return;
300
301 // START SPECIALS
302
303         case 256+GLUT_KEY_F10: {
304             fgToggleFDMdataLogging();
305             return;
306         }
307
308 // END SPECIALS
309
310         }
311
312
313     } else {
314         SG_LOG( SG_INPUT, SG_DEBUG, "" );
315         switch (k) {
316         case 104: // h key
317             HUD_masterswitch( true );
318             return;
319         case 105: // i key
320             fgHUDInit(&current_aircraft);  // normal HUD
321             return;
322
323 // START SPECIALS
324
325         case 256+GLUT_KEY_F6: // F6 toggles Autopilot target location
326             if ( current_autopilot->get_HeadingMode() !=
327                  FGAutopilot::FG_HEADING_WAYPOINT ) {
328                 current_autopilot->set_HeadingMode(
329                     FGAutopilot::FG_HEADING_WAYPOINT );
330                 current_autopilot->set_HeadingEnabled( true );
331             } else {
332                 current_autopilot->set_HeadingMode(
333                     FGAutopilot::FG_TC_HEADING_LOCK );
334             }
335             return;
336         case 256+GLUT_KEY_F8: {// F8 toggles fog ... off fastest nicest...
337             const string &fog = fgGetString("/sim/rendering/fog");
338             if (fog == "disabled") {
339               fgSetString("/sim/rendering/fog", "fastest");
340               SG_LOG(SG_INPUT, SG_INFO, "Fog enabled, hint=fastest");
341             } else if (fog == "fastest") {
342               fgSetString("/sim/rendering/fog", "nicest");
343               SG_LOG(SG_INPUT, SG_INFO, "Fog enabled, hint=nicest");
344             } else if (fog == "nicest") {
345               fgSetString("/sim/rendering/fog", "disabled");
346               SG_LOG(SG_INPUT, SG_INFO, "Fog disabled");
347             } else {
348               fgSetString("/sim/rendering/fog", "disabled");
349               SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized fog type "
350                      << fog << ", changed to 'disabled'");
351             }
352             return;
353         }
354         case 256+GLUT_KEY_F10: // F10 toggles menu on and off...
355             SG_LOG(SG_INPUT, SG_INFO, "Invoking call back function");
356             guiToggleMenu();
357             return;
358         case 256+GLUT_KEY_F11: // F11 Altitude Dialog.
359             SG_LOG(SG_INPUT, SG_INFO, "Invoking Altitude call back function");
360             NewAltitude( NULL );
361             return;
362         case 256+GLUT_KEY_F12: // F12 Heading Dialog...
363             SG_LOG(SG_INPUT, SG_INFO, "Invoking Heading call back function");
364             NewHeading( NULL );
365             return;
366         }
367
368 // END SPECIALS
369
370     }
371 }
372
373
374 void
375 FGInput::_init_keyboard ()
376 {
377                                 // TODO: zero the old bindings first.
378   SG_LOG(SG_INPUT, SG_INFO, "Initializing key bindings");
379   SGPropertyNode * key_nodes = fgGetNode("/input/keyboard");
380   if (key_nodes == 0) {
381     SG_LOG(SG_INPUT, SG_ALERT, "No key bindings (/input/keyboard)!!");
382     return;
383   }
384   
385   vector<SGPropertyNode *> keys = key_nodes->getChildren("key");
386   for (unsigned int i = 0; i < keys.size(); i++) {
387     int index = keys[i]->getIndex();
388     SG_LOG(SG_INPUT, SG_INFO, "Binding key " << index);
389     _key_bindings[index].is_repeatable = keys[i]->getBoolValue("repeatable");
390     _read_bindings(keys[i], _key_bindings[index].bindings, FG_MOD_NONE);
391   }
392 }
393
394
395 void
396 FGInput::_init_joystick ()
397 {
398                                 // TODO: zero the old bindings first.
399   SG_LOG(SG_INPUT, SG_INFO, "Initializing joystick bindings");
400   SGPropertyNode * js_nodes = fgGetNode("/input/joysticks");
401   if (js_nodes == 0) {
402     SG_LOG(SG_INPUT, SG_ALERT, "No joystick bindings (/input/joysticks)!!");
403     return;
404   }
405
406   for (int i = 0; i < MAX_JOYSTICKS; i++) {
407     const SGPropertyNode * js_node = js_nodes->getChild("js", i);
408     if (js_node == 0) {
409       SG_LOG(SG_INPUT, SG_ALERT, "No bindings for joystick " << i);
410       continue;
411     }
412     jsJoystick * js = new jsJoystick(i);
413     _joystick_bindings[i].js = js;
414     if (js->notWorking()) {
415       SG_LOG(SG_INPUT, SG_INFO, "Joystick " << i << " not found");
416       continue;
417     }
418 #ifdef WIN32
419     JOYCAPS jsCaps ;
420     joyGetDevCaps( i, &jsCaps, sizeof(jsCaps) );
421     int nbuttons = jsCaps.wNumButtons;
422     if (nbuttons > MAX_BUTTONS) nbuttons = MAX_BUTTONS;
423 #else
424     int nbuttons = MAX_BUTTONS;
425 #endif
426         
427     int naxes = js->getNumAxes();
428     if (naxes > MAX_AXES) naxes = MAX_AXES;
429     _joystick_bindings[i].naxes = naxes;
430     _joystick_bindings[i].nbuttons = nbuttons;
431
432     SG_LOG(SG_INPUT, SG_INFO, "Initializing joystick " << i);
433
434                                 // Set up range arrays
435     float minRange[MAX_AXES];
436     float maxRange[MAX_AXES];
437     float center[MAX_AXES];
438
439                                 // Initialize with default values
440     js->getMinRange(minRange);
441     js->getMaxRange(maxRange);
442     js->getCenter(center);
443
444                                 // Allocate axes and buttons
445     _joystick_bindings[i].axes = new axis[naxes];
446     _joystick_bindings[i].buttons = new button[nbuttons];
447
448
449     //
450     // Initialize the axes.
451     //
452     int j;
453     for (j = 0; j < naxes; j++) {
454       const SGPropertyNode * axis_node = js_node->getChild("axis", j);
455       if (axis_node == 0) {
456         SG_LOG(SG_INPUT, SG_INFO, "No bindings for axis " << j);
457         continue;
458       }
459       
460       axis &a = _joystick_bindings[i].axes[j];
461
462       js->setDeadBand(j, axis_node->getDoubleValue("dead-band", 0.0));
463
464       a.tolerance = axis_node->getDoubleValue("tolerance", 0.002);
465       minRange[j] = axis_node->getDoubleValue("min-range", minRange[j]);
466       maxRange[j] = axis_node->getDoubleValue("max-range", maxRange[j]);
467       center[j] = axis_node->getDoubleValue("center", center[j]);
468
469       _read_bindings(axis_node, a.bindings, FG_MOD_NONE);
470
471       // Initialize the virtual axis buttons.
472       _init_button(axis_node->getChild("low"), a.low, "low");
473       a.low_threshold = axis_node->getDoubleValue("low-threshold", -0.9);
474       
475       _init_button(axis_node->getChild("high"), a.high, "high");
476       a.high_threshold = axis_node->getDoubleValue("high-threshold", 0.9);
477     }
478
479     //
480     // Initialize the buttons.
481     //
482     char buf[8];
483     for (j = 0; j < nbuttons; j++) {
484       sprintf(buf, "%d", j);
485       SG_LOG(SG_INPUT, SG_INFO, "Initializing button " << j);
486       _init_button(js_node->getChild("button", j),
487                    _joystick_bindings[i].buttons[j],
488                    buf);
489                    
490     }
491
492     js->setMinRange(minRange);
493     js->setMaxRange(maxRange);
494     js->setCenter(center);
495   }
496 }
497
498
499 inline void
500 FGInput::_init_button (const SGPropertyNode * node,
501                        button &b,
502                        const string name)
503 {       
504   if (node == 0)
505     SG_LOG(SG_INPUT, SG_INFO, "No bindings for button " << name);
506   else {
507     b.is_repeatable = node->getBoolValue("repeatable", b.is_repeatable);
508     
509                 // Get the bindings for the button
510     _read_bindings(node, b.bindings, FG_MOD_NONE);
511   }
512 }
513
514
515 void
516 FGInput::_update_keyboard ()
517 {
518   // no-op
519 }
520
521
522 void
523 FGInput::_update_joystick ()
524 {
525   int modifiers = FG_MOD_NONE;  // FIXME: any way to get the real ones?
526   int buttons;
527   // float js_val, diff;
528   float axis_values[MAX_AXES];
529
530   int i;
531   int j;
532
533   for ( i = 0; i < MAX_JOYSTICKS; i++) {
534
535     jsJoystick * js = _joystick_bindings[i].js;
536     if (js == 0 || js->notWorking())
537       continue;
538
539     js->read(&buttons, axis_values);
540
541
542                                 // Fire bindings for the axes.
543     for ( j = 0; j < _joystick_bindings[i].naxes; j++) {
544       axis &a = _joystick_bindings[i].axes[j];
545       
546                                 // Do nothing if the axis position
547                                 // is unchanged; only a change in
548                                 // position fires the bindings.
549       if (fabs(axis_values[j] - a.last_value) > a.tolerance) {
550 //      SG_LOG(SG_INPUT, SG_INFO, "Axis " << j << " has moved");
551         SGPropertyNode node;
552         a.last_value = axis_values[j];
553 //      SG_LOG(SG_INPUT, SG_INFO, "There are "
554 //             << a.bindings[modifiers].size() << " bindings");
555         for (unsigned int k = 0; k < a.bindings[modifiers].size(); k++)
556           a.bindings[modifiers][k].fire(axis_values[j]);
557       }
558      
559                                 // do we have to emulate axis buttons?
560       if (a.low.bindings[modifiers].size())
561         _update_button(_joystick_bindings[i].axes[j].low,
562                        modifiers,
563                        axis_values[j] < a.low_threshold);
564       
565       if (a.high.bindings[modifiers].size())
566         _update_button(_joystick_bindings[i].axes[j].high,
567                        modifiers,
568                        axis_values[j] > a.high_threshold);
569     }
570
571                                 // Fire bindings for the buttons.
572     for (j = 0; j < _joystick_bindings[i].nbuttons; j++) {
573       _update_button(_joystick_bindings[i].buttons[j],
574                      modifiers,
575                      (buttons & (1 << j)) > 0);
576     }
577   }
578 }
579
580
581 void
582 FGInput::_update_button (button &b, int modifiers, bool pressed)
583 {
584   if (pressed) {
585                                 // The press event may be repeated.
586     if (!b.last_state || b.is_repeatable) {
587       SG_LOG(SG_INPUT, SG_INFO, "Button has been pressed");
588       for (unsigned int k = 0; k < b.bindings[modifiers].size(); k++)
589         b.bindings[modifiers][k].fire();
590     }
591   } else {
592                                 // The release event is never repeated.
593     if (b.last_state) {
594       SG_LOG(SG_INPUT, SG_INFO, "Button has been released");
595       for (unsigned int k = 0; k < b.bindings[modifiers|FG_MOD_UP].size(); k++)
596         b.bindings[modifiers|FG_MOD_UP][k].fire();
597     }
598   }
599           
600   b.last_state = pressed;
601 }  
602
603
604 void
605 FGInput::_read_bindings (const SGPropertyNode * node, 
606                          binding_list_t * binding_list,
607                          int modifiers)
608 {
609   SG_LOG(SG_INPUT, SG_INFO, "Reading all bindings");
610   vector<const SGPropertyNode *> bindings = node->getChildren("binding");
611   for (unsigned int i = 0; i < bindings.size(); i++) {
612     SG_LOG(SG_INPUT, SG_INFO, "Reading binding "
613            << bindings[i]->getStringValue("command"));
614     binding_list[modifiers].push_back(FGBinding(bindings[i]));
615   }
616
617                                 // Read nested bindings for modifiers
618   if (node->getChild("mod-up") != 0)
619     _read_bindings(node->getChild("mod-up"), binding_list,
620                    modifiers|FG_MOD_UP);
621
622   if (node->getChild("mod-shift") != 0)
623     _read_bindings(node->getChild("mod-shift"), binding_list,
624                    modifiers|FG_MOD_SHIFT);
625
626   if (node->getChild("mod-ctrl") != 0)
627     _read_bindings(node->getChild("mod-ctrl"), binding_list,
628                    modifiers|FG_MOD_CTRL);
629
630   if (node->getChild("mod-alt") != 0)
631     _read_bindings(node->getChild("mod-alt"), binding_list,
632                    modifiers|FG_MOD_ALT);
633 }
634
635
636 const vector<FGBinding> &
637 FGInput::_find_key_bindings (unsigned int k, int modifiers)
638 {
639   button &b = _key_bindings[k];
640
641                                 // Try it straight, first.
642   if (b.bindings[modifiers].size() > 0)
643     return b.bindings[modifiers];
644
645                                 // Try removing the control modifier
646                                 // for control keys.
647   else if ((modifiers&FG_MOD_CTRL) && iscntrl(k))
648     return _find_key_bindings(k, modifiers&~FG_MOD_CTRL);
649
650                                 // Try removing shift modifier 
651                                 // for upper case or any punctuation
652                                 // (since different keyboards will
653                                 // shift different punctuation types)
654   else if ((modifiers&FG_MOD_SHIFT) && (isupper(k) || ispunct(k)))
655     return _find_key_bindings(k, modifiers&~FG_MOD_SHIFT);
656
657                                 // Try removing alt modifier for
658                                 // high-bit characters.
659   else if ((modifiers&FG_MOD_ALT) && k >= 128 && k < 256)
660     return _find_key_bindings(k, modifiers&~FG_MOD_ALT);
661
662                                 // Give up and return the empty vector.
663   else
664     return b.bindings[modifiers];
665 }
666
667
668 /**
669  * Construct the modifiers.
670  */
671 static inline int get_mods ()
672 {
673   int glut_modifiers = glutGetModifiers();
674   int modifiers = 0;
675
676   if (glut_modifiers & GLUT_ACTIVE_SHIFT)
677     modifiers |= FGInput::FG_MOD_SHIFT;
678   if (glut_modifiers & GLUT_ACTIVE_CTRL)
679     modifiers |= FGInput::FG_MOD_CTRL;
680   if (glut_modifiers & GLUT_ACTIVE_ALT)
681     modifiers |= FGInput::FG_MOD_ALT;
682
683   return modifiers;
684 }
685
686
687 /**
688  * Key-down event handler for Glut.
689  *
690  * <p>Pass the value on to the FGInput module unless PUI wants it.</p>
691  *
692  * @param k The integer value for the key pressed.
693  * @param x (unused)
694  * @param y (unused)
695  */
696 void GLUTkey(unsigned char k, int x, int y)
697 {
698                                 // Give PUI a chance to grab it first.
699   if (!puKeyboard(k, PU_DOWN))
700     current_input.doKey(k, get_mods(), x, y);
701 }
702
703
704 /**
705  * Key-up event handler for GLUT.
706  *
707  * <p>PUI doesn't use this, so always pass it to the input manager.</p>
708  *
709  * @param k The integer value for the key pressed.
710  * @param x (unused)
711  * @param y (unused)
712  */
713 void GLUTkeyup(unsigned char k, int x, int y)
714 {
715   current_input.doKey(k, get_mods()|FGInput::FG_MOD_UP, x, y);
716 }
717
718
719 /**
720  * Special key-down handler for Glut.
721  *
722  * <p>Pass the value on to the FGInput module unless PUI wants it.
723  * The key value will have 256 added to it.</p>
724  *
725  * @param k The integer value for the key pressed (will have 256 added
726  * to it).
727  * @param x (unused)
728  * @param y (unused)
729  */
730 void GLUTspecialkey(int k, int x, int y)
731 {
732                                 // Give PUI a chance to grab it first.
733   if (!puKeyboard(k + PU_KEY_GLUT_SPECIAL_OFFSET, PU_DOWN))
734     current_input.doKey(k + 256, get_mods(), x, y);
735 }
736
737
738 /**
739  * Special key-up handler for Glut.
740  *
741  * @param k The integer value for the key pressed (will have 256 added
742  * to it).
743  * @param x (unused)
744  * @param y (unused)
745  */
746 void GLUTspecialkeyup(int k, int x, int y)
747 {
748   current_input.doKey(k + 256, get_mods()|FGInput::FG_MOD_UP, x, y);
749 }
750
751 // end of input.cxx