Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 1, 2008, 8:33:53 PM (17 years ago)
Author:
rgrieder
Message:
  • Key bindings can now be stored in keybindings.ini
  • doesn't work for move movement yet, but for the buttons.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/input/src/core/InputHandler.h

    r1203 r1213  
    3939#include <string>
    4040#include "ois/OIS.h"
     41#include "OrxonoxClass.h"
    4142
    4243namespace orxonox
     
    8586           Manages the key bindings.
    8687  */
    87   class _CoreExport KeyBinder : public KeyHandler, public MouseHandler, public JoyStickHandler
     88  class _CoreExport KeyBinder : public KeyHandler, public MouseHandler, public JoyStickHandler, public OrxonoxClass
    8889  {
    8990  public:
     
    9394    bool loadBindings();
    9495    void clearBindings();
     96
     97    void setConfigValues();
     98
     99    std::string testtest;
    95100
    96101  private: // functions
     
    112117
    113118  private: // variables
    114     /** denotes the maximum number of different keys there are in OIS.
    115         256 should be ok since the highest number in the OIS enum is 237. */
    116     static const int numberOfKeys_s = 256;
     119
     120    //! denotes the number of different keys there are in OIS.
     121    static const int numberOfKeys_s = 0xEE;
    117122    //! Array of input events for every pressed key
    118123    std::string bindingsKeyPress_  [numberOfKeys_s];
    119124    //! Array of input events for every released key
    120125    std::string bindingsKeyRelease_[numberOfKeys_s];
    121     //!Array of input events for every held key
     126    //! Array of input events for every held key
    122127    std::string bindingsKeyHold_   [numberOfKeys_s];
     128    //! Names of the keys as strings
     129    std::string keyNames_[numberOfKeys_s];
    123130
    124     /** denotes the maximum number of different buttons there are in OIS.
    125         16 should be ok since the highest number in the OIS enum is 7. */
    126     static const int numberOfMouseButtons_s = 16;
     131    //! denotes the number of different mouse buttons there are in OIS.
     132    static const int numberOfMouseButtons_s = 8;
    127133    //! Array of input events for every pressed mouse button
    128134    std::string bindingsMouseButtonPress_  [numberOfMouseButtons_s];
     
    131137    //! Array of input events for every held mouse button
    132138    std::string bindingsMouseButtonHold_   [numberOfMouseButtons_s];
     139    //! Names of the mouse buttons as strings
     140    std::string mouseButtonNames_[numberOfMouseButtons_s];
    133141
    134     /** denotes the maximum number of different buttons there are in OIS.
    135         32 should be ok. */
     142    //! denotes the number of different joy stick buttons there are in OIS.
    136143    static const int numberOfJoyStickButtons_s = 32;
    137144    //! Array of input events for every pressed joy stick button
     
    141148    //! Array of input events for every held joy stick button
    142149    std::string bindingsJoyStickButtonHold_   [numberOfJoyStickButtons_s];
     150    //! Names of the joy stick buttons as strings
     151    std::string joyStickButtonNames_[numberOfJoyStickButtons_s];
    143152
    144153  };
Note: See TracChangeset for help on using the changeset viewer.