Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: key mapper implementation precess

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