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/InputManager.h

    r1788 r1878  
    108108        void reloadInputSystem(bool joyStickSupport = true);
    109109
     110        void clearBuffers();
     111
    110112        int  numberOfKeyboards() { return keyboard_ ? 1 : 0; }
    111113        int  numberOfMice()      { return mouse_    ? 1 : 0; }
     
    115117
    116118        template <class T>
    117         T* createInputState(const std::string& name, int priority)
    118         {
    119             T* state = new T;
    120             if (_configureInputState(state, name, priority))
    121                 return state;
    122             else
    123             {
    124                 delete state;
    125                 return 0;
    126             }
    127         }
     119        T* createInputState(const std::string& name, int priority);
    128120
    129121        InputState* getState       (const std::string& name);
     
    139131        static InputManager* getInstancePtr() { return singletonRef_s; }
    140132
    141     public: // console commands
     133        // console commands
    142134        static void storeKeyStroke(const std::string& name);
    143135        static void keyBind(const std::string& command);
    144136        static void calibrate();
    145137        static void reload(bool joyStickSupport = true);
     138
     139    public: // variables
     140        static EmptyHandler                 EMPTY_HANDLER;
    146141
    147142    private: // functions
     
    197192        InputManagerState                   internalState_;        //!< Current internal state
    198193
    199         // some internally handled states
     194        // some internally handled states and handlers
    200195        SimpleInputState*                   stateDetector_;        //!< KeyDetector instance
    201196        SimpleInputState*                   stateCalibrator_;
     
    234229        static InputManager*                singletonRef_s;
    235230    };
     231
     232    /**
     233    @brief
     234        Creates a new InputState by type, name and priority.
     235       
     236        You will have to use this method because the
     237        c'tors and d'tors are private.
     238    @remarks
     239        The InputManager will take care of the state completely. That also
     240        means it gets deleted when the InputManager is destroyed!
     241    @param name
     242        Name of the InputState when referenced as string
     243    @param priority
     244        Priority matters when multiple states are active. You can specify any
     245        number, but 1 - 99 is preferred (99 means high).
     246    */
     247    template <class T>
     248    T* InputManager::createInputState(const std::string& name, int priority)
     249    {
     250        T* state = new T;
     251        if (_configureInputState(state, name, priority))
     252            return state;
     253        else
     254        {
     255            delete state;
     256            return 0;
     257        }
     258    }
    236259}
    237260
Note: See TracChangeset for help on using the changeset viewer.