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/core/input/SimpleInputState.cc

    r1755 r1878  
    184184    }
    185185
    186     void SimpleInputState::removeAndDestroyAllHandlers()
    187     {
    188         for (std::vector<InputTickable*>::iterator it = allHandlers_.begin();
    189             it != allHandlers_.end(); ++it)
    190             delete *it;
    191 
    192         allHandlers_.clear();
    193         keyHandler_ = 0;
    194         mouseHandler_ = 0;
    195         joyStickHandlerAll_ = 0;
    196         for (unsigned int iJoyStick = 0; iJoyStick < joyStickHandler_.size(); ++iJoyStick)
    197             joyStickHandler_[iJoyStick] = 0;
    198 
    199         update();
    200     }
     186    //void SimpleInputState::removeAndDestroyAllHandlers()
     187    //{
     188    //    for (std::vector<InputHandler*>::iterator it = allHandlers_.begin();
     189    //        it != allHandlers_.end(); ++it)
     190    //        delete *it;
     191
     192    //    allHandlers_.clear();
     193    //    keyHandler_ = 0;
     194    //    mouseHandler_ = 0;
     195    //    joyStickHandlerAll_ = 0;
     196    //    for (unsigned int iJoyStick = 0; iJoyStick < joyStickHandler_.size(); ++iJoyStick)
     197    //        joyStickHandler_[iJoyStick] = 0;
     198
     199    //    update();
     200    //}
    201201
    202202    /**
     
    208208        True if added, false if handler already existed.
    209209    */
    210     bool SimpleInputState::setHandler(InputTickable* handler)
     210    bool SimpleInputState::setHandler(InputHandler* handler)
    211211    {
    212212        setKeyHandler(dynamic_cast<KeyHandler*>(handler));
     
    247247    {
    248248        // we can use a set to have a list of unique pointers (an object can implement all 3 handlers)
    249         std::set<InputTickable*> tempSet;
     249        std::set<InputHandler*> tempSet;
    250250        if (keyHandler_)
    251251            tempSet.insert(keyHandler_);
     
    258258        // copy the content of the map back to the actual vector
    259259        allHandlers_.clear();
    260         for (std::set<InputTickable*>::const_iterator itHandler = tempSet.begin();
     260        for (std::set<InputHandler*>::const_iterator itHandler = tempSet.begin();
    261261            itHandler != tempSet.end(); itHandler++)
    262262            allHandlers_.push_back(*itHandler);
     
    267267        for (unsigned int i = 0; i < joyStickHandler_.size(); ++i)
    268268            setInputDeviceEnabled(2 + i, (joyStickHandler_[i] != 0));
     269
     270        // inform InputManager that there might be changes in EMPTY_HANDLER situation
     271        bHandlersChanged_ = true;
    269272    }
    270273}
Note: See TracChangeset for help on using the changeset viewer.