Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 3, 2008, 1:26:48 PM (16 years ago)
Author:
rgrieder
Message:

Fixed two issues with input:

  • Buffer gets cleared now when the window focus changes
  • Added a configValue in the InGameConsole:

Until now the input was always transparent to the level when activating the console (exception keyboard input of course)
bHidesAllInput_ can change that setting (configured in orxonox.ini)

@Oli: Sorry, couldn't apply the patch in the network branch because of conflicts (I have already made some changes to the InputManager in the trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/overlays/console/InGameConsole.cc

    r1819 r1878  
    7070        , consoleOverlayBorder_(0)
    7171        , consoleOverlayTextAreas_(0)
     72        , inputState_(0)
    7273    {
    7374        RegisterObject(InGameConsole);
     
    143144        SetConfigValue(noiseSize_, 1.0f);
    144145        SetConfigValue(cursorSymbol_, '|');
     146        SetConfigValue(bHidesAllInput_, false).callback(this, &InGameConsole::bHidesAllInputChanged);
     147    }
     148
     149    /**
     150        @brief Called whenever bHidesAllInput_ changes.
     151    */
     152    void InGameConsole::bHidesAllInputChanged()
     153    {
     154        if (inputState_)
     155        {
     156            if (bHidesAllInput_)
     157            {
     158                inputState_->setMouseHandler(&InputManager::EMPTY_HANDLER);
     159                inputState_->setJoyStickHandler(&InputManager::EMPTY_HANDLER);
     160            }
     161            else
     162            {
     163                inputState_->setMouseHandler(0);
     164                inputState_->setJoyStickHandler(0);
     165            }
     166        }
    145167    }
    146168
     
    151173    {
    152174        // create the corresponding input state
    153         InputManager::getInstance().createInputState<SimpleInputState>("console", 40)
    154             ->setKeyHandler(Shell::getInstance().getInputBuffer());
     175        inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("console", 40);
     176        inputState_->setKeyHandler(Shell::getInstance().getInputBuffer());
     177        bHidesAllInputChanged();
    155178
    156179        // create overlay and elements
Note: See TracChangeset for help on using the changeset viewer.