Example #1
0
        public override void KeyEvent(Int32 key)
        {
            switch (key)
            {
            case KeysDef.K_ESCAPE:
                MainMenu.Show(Host);
                break;

            case KeysDef.K_ENTER:
                Host.Menu.EnterSound = true;
                switch (_Cursor)
                {
                case 0:
                    KeysMenu.Show(Host);
                    break;

                case 1:
                    CurrentMenu.Hide( );
                    Host.Console.ToggleConsole_f(null);
                    break;

                case 2:
                    Host.Commands.Buffer.Append("exec default.cfg\n");
                    break;

                case 12:
                    VideoMenu.Show(Host);
                    break;

                default:
                    AdjustSliders(1);
                    break;
                }
                return;

            case KeysDef.K_UPARROW:
                Host.Sound.LocalSound("misc/menu1.wav");
                _Cursor--;
                if (_Cursor < 0)
                {
                    _Cursor = OPTIONS_ITEMS - 1;
                }
                break;

            case KeysDef.K_DOWNARROW:
                Host.Sound.LocalSound("misc/menu1.wav");
                _Cursor++;
                if (_Cursor >= OPTIONS_ITEMS)
                {
                    _Cursor = 0;
                }
                break;

            case KeysDef.K_LEFTARROW:
                AdjustSliders(-1);
                break;

            case KeysDef.K_RIGHTARROW:
                AdjustSliders(1);
                break;
            }

            /*if( _Cursor == 12 && VideoMenu == null )
             * {
             *  if( key == KeysDef.K_UPARROW )
             *      _Cursor = 11;
             *  else
             *      _Cursor = 0;
             * }*/

            if (_Cursor == 12)
            {
                if (key == KeysDef.K_UPARROW)
                {
                    _Cursor = 11;
                }
                else
                {
                    _Cursor = 0;
                }
            }

            /*#if _WIN32
             *          if ((options_cursor == 13) && (modestate != MS_WINDOWED))
             *          {
             *              if (k == K_UPARROW)
             *                  options_cursor = 12;
             *              else
             *                  options_cursor = 0;
             *          }
             #endif*/
        }