- } else {
- SG_LOG( SG_INPUT, SG_DEBUG, "" );
- switch (k) {
- case 104: // h key
- HUD_masterswitch( true );
- return;
- case 105: // i key
- fgHUDInit(¤t_aircraft); // normal HUD
- return;
- case 109: // m key
- globals->inc_warp( 60 );
- fgUpdateSkyAndLightingParams();
- return;
- case 112: // p key
- globals->set_freeze( ! globals->get_freeze() );
-
- {
- SGBucket p( f->get_Longitude() * SGD_RADIANS_TO_DEGREES,
- f->get_Latitude() * SGD_RADIANS_TO_DEGREES );
- SGPath tile_path( globals->get_fg_root() );
- tile_path.append( "Scenery" );
- tile_path.append( p.gen_base_path() );
- tile_path.append( p.gen_index_str() );
-
- // printf position and attitude information
- SG_LOG( SG_INPUT, SG_INFO,
- "Lon = " << f->get_Longitude() * SGD_RADIANS_TO_DEGREES
- << " Lat = " << f->get_Latitude() * SGD_RADIANS_TO_DEGREES
- << " Altitude = " << f->get_Altitude() * SG_FEET_TO_METER
- );
- SG_LOG( SG_INPUT, SG_INFO,
- "Heading = " << f->get_Psi() * SGD_RADIANS_TO_DEGREES
- << " Roll = " << f->get_Phi() * SGD_RADIANS_TO_DEGREES
- << " Pitch = " << f->get_Theta() * SGD_RADIANS_TO_DEGREES );
- SG_LOG( SG_INPUT, SG_INFO, tile_path.c_str());
- }
- return;
- case 116: // t key
- globals->inc_warp_delta( 30 );
- fgUpdateSkyAndLightingParams();
- return;
- case 120: // x key
- fov = globals->get_current_view()->get_fov();
- fov /= 1.05;
- if ( fov < FG_FOV_MIN ) {
- fov = FG_FOV_MIN;
- }
- globals->get_current_view()->set_fov(fov);
- // v->force_update_fov_math();
- return;
- case 122: // z key
-#ifndef FG_OLD_WEATHER
- tmp = WeatherDatabase->getWeatherVisibility();
- tmp *= 1.10;
- WeatherDatabase->setWeatherVisibility( tmp );
-#else
- tmp = current_weather.get_visibility(); // in meters
- tmp *= 1.10;
- current_weather.set_visibility( tmp );
-#endif
- return;
- case 27: // ESC
- // if( fg_DebugOutput ) {
- // fclose( fg_DebugOutput );
- // }
- SG_LOG( SG_INPUT, SG_ALERT,
- "Program exit requested." );
- ConfirmExitDialog();
- return;
-
-// START SPECIALS
-
- case 256+GLUT_KEY_F2: // F2 Reload Tile Cache...
- {
- bool freeze = globals->get_freeze();
- SG_LOG(SG_INPUT, SG_INFO, "ReIniting TileCache");
- if ( !freeze )
- globals->set_freeze( true );
- BusyCursor(0);
- if ( global_tile_mgr.init() ) {
- // Load the local scenery data
- global_tile_mgr.update(
- cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES,
- cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES );
- } else {
- SG_LOG( SG_GENERAL, SG_ALERT,
- "Error in Tile Manager initialization!" );
- exit(-1);
- }
- BusyCursor(1);
- if ( !freeze )
- globals->set_freeze( false );
- return;
- }
- case 256+GLUT_KEY_F4: // F4 Update lighting manually
- fgUpdateSkyAndLightingParams();
- return;
- case 256+GLUT_KEY_F6: // F6 toggles Autopilot target location
- if ( current_autopilot->get_HeadingMode() !=
- FGAutopilot::FG_HEADING_WAYPOINT ) {
- current_autopilot->set_HeadingMode(
- FGAutopilot::FG_HEADING_WAYPOINT );
- current_autopilot->set_HeadingEnabled( true );
- } else {
- current_autopilot->set_HeadingMode(
- FGAutopilot::FG_TC_HEADING_LOCK );
- }
- return;
- case 256+GLUT_KEY_F8: {// F8 toggles fog ... off fastest nicest...
- const string &fog = fgGetString("/sim/rendering/fog");
- if (fog == "disabled") {
- fgSetString("/sim/rendering/fog", "fastest");
- SG_LOG(SG_INPUT, SG_INFO, "Fog enabled, hint=fastest");
- } else if (fog == "fastest") {
- fgSetString("/sim/rendering/fog", "nicest");
- SG_LOG(SG_INPUT, SG_INFO, "Fog enabled, hint=nicest");
- } else if (fog == "nicest") {
- fgSetString("/sim/rendering/fog", "disabled");
- SG_LOG(SG_INPUT, SG_INFO, "Fog disabled");
- } else {
- fgSetString("/sim/rendering/fog", "disabled");
- SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized fog type "
- << fog << ", changed to 'disabled'");
- }
- return;
- }
- case 256+GLUT_KEY_F9: // F9 toggles textures on and off...
- SG_LOG( SG_INPUT, SG_INFO, "Toggling texture" );
- if ( fgGetBool("/sim/rendering/textures")) {
- fgSetBool("/sim/rendering/textures", false);
- material_lib.set_step( 1 );
- } else {
- fgSetBool("/sim/rendering/textures", true);
- material_lib.set_step( 0 );
- }
- return;
- case 256+GLUT_KEY_F10: // F10 toggles menu on and off...
- SG_LOG(SG_INPUT, SG_INFO, "Invoking call back function");
- guiToggleMenu();
- return;
- case 256+GLUT_KEY_F11: // F11 Altitude Dialog.
- SG_LOG(SG_INPUT, SG_INFO, "Invoking Altitude call back function");
- NewAltitude( NULL );
- return;
- case 256+GLUT_KEY_F12: // F12 Heading Dialog...
- SG_LOG(SG_INPUT, SG_INFO, "Invoking Heading call back function");
- NewHeading( NULL );
- return;
- }
-
-// END SPECIALS