Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 8, 2009, 9:47:28 PM (15 years ago)
Author:
rgrieder
Message:
  • Fixed force feedback output pollution problem in OIS.
  • Fixed InputManager too many times reloading problem.
Location:
code/branches/core5/src/libraries/core/input
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/libraries/core/input/InputManager.cc

    r5869 r5910  
    8787        , oisInputManager_(0)
    8888        , devices_(2)
    89         , bExclusiveMouse_(false)
     89        , mouseMode_(MouseMode::Nonexclusive)
    9090        , emptyState_(0)
    9191        , calibratorCallbackHandler_(0)
     
    9797        this->setConfigValues();
    9898
     99        if (GraphicsManager::getInstance().isFullScreen())
     100            mouseMode_ = MouseMode::Exclusive;
    99101        this->loadDevices();
    100102
     
    153155        paramList.insert(std::make_pair("w32_keyboard", "DISCL_FOREGROUND"));
    154156        paramList.insert(std::make_pair("w32_mouse", "DISCL_FOREGROUND"));
    155         if (bExclusiveMouse_ || GraphicsManager::getInstance().isFullScreen())
     157        if (mouseMode_ == MouseMode::Exclusive || GraphicsManager::getInstance().isFullScreen())
    156158        {
    157159            // Disable Windows key plus special keys (like play, stop, next, etc.)
     
    502504
    503505        // Check whether we have to change the mouse mode
     506        MouseMode::Value requestedMode = MouseMode::Dontcare;
    504507        std::vector<InputState*>& mouseStates = devices_[InputDeviceEnumerator::Mouse]->getStateListRef();
    505         if (mouseStates.empty() && bExclusiveMouse_ ||
    506             !mouseStates.empty() && mouseStates.front()->getIsExclusiveMouse() != bExclusiveMouse_)
    507         {
    508             bExclusiveMouse_ = !bExclusiveMouse_;
     508        if (mouseStates.empty())
     509            requestedMode = MouseMode::Nonexclusive;
     510        else
     511            requestedMode = mouseStates.front()->getMouseMode();
     512        if (requestedMode != MouseMode::Dontcare && mouseMode_ != requestedMode)
     513        {
     514            mouseMode_ = requestedMode;
    509515            if (!GraphicsManager::getInstance().isFullScreen())
    510516                this->reloadInternal();
  • code/branches/core5/src/libraries/core/input/InputManager.h

    r5869 r5910  
    191191        OIS::InputManager*                  oisInputManager_;      //!< OIS input manager
    192192        std::vector<InputDevice*>           devices_;              //!< List of all input devices (keyboard, mouse, joy sticks)
    193         bool                                bExclusiveMouse_;      //!< Currently applied mouse mode
     193        MouseMode::Value                    mouseMode_;            //!< Currently applied mouse mode
    194194
    195195        // some internally handled states and handlers
  • code/branches/core5/src/libraries/core/input/InputState.cc

    r5738 r5910  
    3737        , bAlwaysGetsInput_(bAlwaysGetsInput)
    3838        , bTransparent_(bTransparent)
    39         , bExclusiveMouse_(true)
     39        , mouseMode_(MouseMode::Dontcare)
    4040        , bExpired_(true)
    4141        , handlers_(2)
  • code/branches/core5/src/libraries/core/input/InputState.h

    r5738 r5910  
    5555        static const int Detector     = HighPriority + 2;
    5656    };
     57
     58    namespace MouseMode
     59    {
     60        enum Value
     61        {
     62            Exclusive,
     63            Nonexclusive,
     64            Dontcare
     65        };
     66    }
    5767
    5868    /**
     
    120130        void setHandler        (InputHandler* handler);
    121131
    122         void setIsExclusiveMouse(bool value) { bExclusiveMouse_ = value; this->bExpired_ = true; }
    123         bool getIsExclusiveMouse() const { return bExclusiveMouse_; }
     132        void setMouseMode(MouseMode::Value value) { mouseMode_ = value; this->bExpired_ = true; }
     133        MouseMode::Value getMouseMode() const { return mouseMode_; }
    124134
    125135        //! Returns the name of the state (which is unique!)
     
    174184        const bool                  bAlwaysGetsInput_;      //!< See class declaration for explanation
    175185        const bool                  bTransparent_;          //!< See class declaration for explanation
    176         bool                        bExclusiveMouse_;       //!< See class declaration for explanation
     186        MouseMode::Value            mouseMode_;             //!< See class declaration for explanation
    177187        int                         priority_;              //!< Current priority (might change)
    178188        bool                        bExpired_;              //!< See hasExpired()
Note: See TracChangeset for help on using the changeset viewer.