Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 4398 was 4389, checked in by patrick, 20 years ago

orxonox/trunk: working on keymapping, there are some problems in genericaly map unknown keys to well undefined functions… which is not very surprising :)

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
42 public:
43  static int PEV_UP;
44  static int PEV_DOWN;
45  static int PEV_LEFT;
46  static int PEV_RIGHT;
47 
48  static int PEV_STRAFE_LEFT;
49  static int PEV_STRAFE_RIGHT;
50 
51  static int PEV_FIRE1;
52  static int PEV_FIRE2;
53
54  static int PEV_VIEW1;
55  static int PEV_VIEW2;
56  static int PEV_VIEW3;
57  static int PEV_VIEW4;
58
59 private:
60  KeyBindings* keyAliases;
61  Sint32 coord[2];
62};
63
64#endif /* _KEY_MAPPER_H */
Note: See TracBrowser for help on using the repository browser.