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