source:
orxonox.OLD/orxonox/trunk/gui/orxonox_gui_keys.h
@
3165
Last change on this file since 3165 was 3165, checked in by bensch, 19 years ago | |
---|---|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[2613] | 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" | |
[3165] | 10 | #ifdef HAVE_GTK2 |
[2733] | 11 | #include <gdk/gdkkeysyms.h> |
[3165] | 12 | #endif /* HAVE_GTK2 */ |
[2613] | 13 | /** |
14 | * defines the Possible Player Keys | |
15 | */ | |
[2735] | 16 | enum KEYS { UP, DOWN, LEFT, RIGHT, SHOOT }; |
[2613] | 17 | |
[3152] | 18 | class Player; |
19 | //! Class that creates the Keys-Options. | |
20 | class OrxonoxGuiKeys | |
21 | { | |
22 | private: | |
23 | Frame* keysFrame; | |
24 | Box* keysBox; | |
25 | Player* player1; | |
[3163] | 26 | Player* player2; |
[3152] | 27 | Button* misc; |
28 | ||
29 | public: | |
30 | OrxonoxGuiKeys (); | |
31 | ~OrxonoxGuiKeys (); | |
32 | ||
33 | Widget* getWidget (); | |
34 | }; | |
35 | ||
[2735] | 36 | //! Class to hold infos about a Player |
[2613] | 37 | class Player |
38 | { | |
39 | private: | |
[3152] | 40 | Window* pKeyWindow; |
[3154] | 41 | Frame* pKeyFrame; |
[2613] | 42 | Button* openButton; |
[3152] | 43 | Button* closeButton; |
44 | Box* pKeysBox; | |
[2736] | 45 | |
[3156] | 46 | struct InputKey |
47 | { | |
48 | Box* pKeyBox; | |
49 | Button* pKeyButton; | |
50 | OptionLabel* pKeyOLabel; | |
51 | }; | |
[2735] | 52 | |
[3156] | 53 | InputKey* inputKey[10]; |
[2735] | 54 | |
[3156] | 55 | static Window* inputWindow; |
56 | static Button* inputButton; | |
57 | static long keySignal; | |
[2613] | 58 | public: |
59 | Player(char* player); | |
60 | ||
[2736] | 61 | Widget* addKey (KEYS key, char* name); |
62 | ||
[2613] | 63 | Button* getOpenButton(); |
64 | ||
[3165] | 65 | #ifdef HAVE_GTK2 |
[3156] | 66 | static gint inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* widget); |
67 | static gint key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey); | |
[3165] | 68 | #endif /* HAVE_GTK2 */ |
[2613] | 69 | void setkey(KEYS key); |
70 | ||
71 | }; | |
72 | ||
73 | ||
74 | ||
75 | #endif /* _ORXONOX_GUI_KEYS_H */ |
Note: See TracBrowser
for help on using the repository browser.