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)

Location:
code/trunk/src/orxonox/overlays/console
Files:
2 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
  • code/trunk/src/orxonox/overlays/console/InGameConsole.h

    r1755 r1878  
    8181        void windowResized(int newWidth, int newHeight);
    8282
     83        // config value related
     84        void bHidesAllInputChanged();
     85
    8386        static Ogre::UTFString convert2UTF(std::string s);
    8487
     
    102105        Ogre::TextAreaOverlayElement** consoleOverlayTextAreas_;
    103106
     107        // input related
     108        SimpleInputState* inputState_;
     109
    104110        // config values
    105111        float relativeWidth;
     
    109115        float noiseSize_;
    110116        char cursorSymbol_;
     117        bool bHidesAllInput_;
    111118
    112119        static InGameConsole* singletonRef_s;
Note: See TracChangeset for help on using the changeset viewer.