Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: key mapping alg implementation

File size: 1.1 KB
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//! Key aliasing structure
17/**
18   This structure contains the key aliasing information, e.g. the command strings that
19   have been bound to the keys.
20*/
21typedef struct
22{
23  char keys[N_STD_KEYS][CMD_LENGHT];
24  char buttons[N_BUTTONS][CMD_LENGHT];
25} KeyBindings;
26
27
28//! The map class functionalities
29class KeyMapper : public BaseObject {
30
31 public:
32  KeyMapper();
33  virtual ~KeyMapper();
34
35  void loadKeyBindings(const char* fileName = "~/.orxonox/orxonox.conf");
36
37  void debug();
38
39 private:
40  int* nameToIndex (char* name);
41  void mapKeys();
42
43 public:
44  static int PEV_UP;
45  static int PEV_DOWN;
46  static int PEV_LEFT;
47  static int PEV_RIGHT;
48 
49  static int PEV_STRAFE_LEFT;
50  static int PEV_STRAFE_RIGHT;
51 
52  static int PEV_FIRE1;
53  static int PEV_FIRE2;
54
55  static int PEV_VIEW1;
56  static int PEV_VIEW2;
57  static int PEV_VIEW3;
58  static int PEV_VIEW4;
59
60 private:
61  KeyBindings* keyAliases;
62  Sint32 coord[2];
63};
64
65#endif /* _KEY_MAPPER_H */
Note: See TracBrowser for help on using the repository browser.