Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2008, 8:12:20 PM (16 years ago)
Author:
rgrieder
Message:
  • renamed InputHandler to KeyBinder
  • added feature to detect a key in input part
  • added def_keybindings.ini and removed keybindings.ini
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/core/InputManager.h

    r1349 r1413  
    8080    enum InputState
    8181    {
    82       IS_UNINIT,  //!< InputManager has not yet been initialised.
    83       IS_NONE,    //!< Input is discarded.
    84       IS_NORMAL,  //!< Normal play state. Key and button bindings are active.
    85       IS_GUI,     //!< All OIS input events are passed to CEGUI.
    86       IS_CONSOLE, //!< Keyboard input is redirected to the InputBuffer.
    87       IS_CUSTOM   //!< Any possible configuration.
     82      IS_UNINIT,    //!< InputManager has not yet been initialised.
     83      IS_NONE,      //!< Input is discarded.
     84      IS_NORMAL,    //!< Normal play state. Key and button bindings are active.
     85      IS_GUI,       //!< All OIS input events are passed to CEGUI.
     86      IS_CONSOLE,   //!< Keyboard input is redirected to the InputBuffer.
     87      IS_DETECTION, //!< All the input goes to the KeyDetector
     88      IS_CUSTOM     //!< Any possible configuration.
    8889    };
    8990
     
    103104    static void destroyJoySticks();
    104105
    105     static bool isModifierDown(KeyboardModifier::Enum modifier);
    106     static bool isKeyDown(KeyCode::Enum key);
     106    //static bool isModifierDown(KeyboardModifier::Enum modifier);
     107    //static bool isKeyDown(KeyCode::Enum key);
    107108    //static const MouseState getMouseState();
    108109    //static const JoyStickState getJoyStickState(unsigned int ID);
     
    112113    static void setInputState(const InputState state);
    113114    static InputState getInputState();
     115
     116    static void storeKeyStroke(const std::string& name);
     117    static const std::string& getLastKeyStroke();
    114118
    115119    static bool addKeyHandler                 (KeyHandler* handler, const std::string& name);
     
    172176
    173177  private: // variables
    174     OIS::InputManager*                          inputSystem_; //!< OIS input manager
    175     OIS::Keyboard*                              keyboard_;    //!< OIS mouse
    176     OIS::Mouse*                                 mouse_;       //!< OIS keyboard
    177     std::vector<OIS::JoyStick*>                 joySticks_;   //!< OIS joy sticks
     178    OIS::InputManager*                          inputSystem_;     //!< OIS input manager
     179    OIS::Keyboard*                              keyboard_;        //!< OIS mouse
     180    OIS::Mouse*                                 mouse_;           //!< OIS keyboard
     181    std::vector<OIS::JoyStick*>                 joySticks_;       //!< OIS joy sticks
    178182    unsigned int                                joySticksSize_;
     183
     184    KeyBinder*                                  keyBinder_;       //!< KeyBinder instance
     185    KeyDetector*                                keyDetector_;     //!< KeyDetector instance
     186    InputBuffer*                                buffer_;          //!< InputBuffer instance
    179187
    180188    InputState state_;
    181189    InputState stateRequest_;
    182190    unsigned int keyboardModifiers_;
     191    std::string lastStroke_;
    183192
    184193    //! Keeps track of the joy stick POV states
     
    194203    std::vector<MouseHandler*>                  activeMouseHandlers_;
    195204    std::vector<std::vector<JoyStickHandler*> > activeJoyStickHandlers_;
    196     std::vector<InputTickable*>                activeHandlers_;
     205    std::vector<std::pair<InputTickable*, HandlerState> > activeHandlers_;
    197206
    198207    std::vector<Key>                            keysDown_;
Note: See TracChangeset for help on using the changeset viewer.