Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/gui/orxonox_gui_keys.h @ 3159

Last change on this file since 3159 was 3156, checked in by bensch, 20 years ago

orxonox/trunk/gui: setting keys is really sexy now

File size: 1.2 KB
Line 
1/*!
2  \file orxonox_gui_keys.h
3  \brief File that holds the class that creates the Keyboard-Options.
4*/
5
6#ifndef _ORXONOX_GUI_KEYS_H
7#define _ORXONOX_GUI_KEYS_H
8
9#include "orxonox_gui.h"
10#include <gdk/gdkkeysyms.h>
11
12/**
13 * defines the Possible Player Keys
14 */
15enum KEYS { UP, DOWN, LEFT, RIGHT, SHOOT };
16
17class Player;
18//! Class that creates the Keys-Options.
19class OrxonoxGuiKeys
20{
21 private:
22  Frame* keysFrame;
23  Box* keysBox;
24  Player* player1;
25  //  Player* player2;
26  Button* misc;
27
28 public:
29  OrxonoxGuiKeys ();
30  ~OrxonoxGuiKeys ();
31 
32  Widget* getWidget ();
33};
34
35//! Class to hold infos about a Player
36class Player
37{
38 private:
39  Window* pKeyWindow;
40  Frame* pKeyFrame;
41  Button* openButton;
42  Button* closeButton;
43  Box* pKeysBox;
44 
45  struct InputKey
46  {
47    Box* pKeyBox;
48    Button* pKeyButton;
49    OptionLabel* pKeyOLabel;
50  };
51
52  InputKey* inputKey[10];
53
54  static Window* inputWindow;
55  static Button* inputButton;
56  static long keySignal;
57 public:
58  Player(char* player);
59
60  Widget* addKey (KEYS key, char* name);
61
62  Button* getOpenButton();
63
64  static gint inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* widget);
65  static gint key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey);
66  void setkey(KEYS key);
67 
68};
69
70
71
72#endif /* _ORXONOX_GUI_KEYS_H */
Note: See TracBrowser for help on using the repository browser.