Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/util/event/key_mapper.h @ 4405

Last change on this file since 4405 was 4405, checked in by patrick, 19 years ago

orxonox/trunk: event_handler subscribe functionality improved

File size: 981 bytes
Line 
1/*!
2    \file key_mapper.h
3    \brief a construct to map player defined keys to SDL keys
4
5*/
6
7#ifndef _KEY_MAPPER_H
8#define _KEY_MAPPER_H
9
10
11#include "base_object.h"
12#include "event_def.h"
13
14
15
16
17
18typedef struct orxKeyMapping
19{
20  int* pValue;
21  char* pName;
22};
23
24
25//! The map class functionalities
26class KeyMapper : public BaseObject {
27
28 public:
29  KeyMapper();
30  virtual ~KeyMapper();
31
32  void loadKeyBindings(const char* fileName = "~/.orxonox/orxonox.conf");
33
34  void debug();
35
36 private:
37  int* nameToIndex (char* name);
38  void mapKeys(char* name, int keyID);
39
40 public:
41  static int PEV_UP;
42  static int PEV_DOWN;
43  static int PEV_LEFT;
44  static int PEV_RIGHT;
45 
46  static int PEV_STRAFE_LEFT;
47  static int PEV_STRAFE_RIGHT;
48 
49  static int PEV_FIRE1;
50  static int PEV_FIRE2;
51
52  static int PEV_VIEW0;
53  static int PEV_VIEW1;
54  static int PEV_VIEW2;
55  static int PEV_VIEW3;
56  static int PEV_VIEW4;
57  static int PEV_VIEW5;
58
59 private:
60  Sint32 coord[2];
61};
62
63
64
65
66#endif /* _KEY_MAPPER_H */
Note: See TracBrowser for help on using the repository browser.