/*! \file orxonox_gui_keys.h \brief File that holds the class that creates the Keyboard-Options. */ #ifndef _ORXONOX_GUI_KEYS_H #define _ORXONOX_GUI_KEYS_H #include "orxonox_gui.h" #ifdef HAVE_GTK2 #include #endif /* HAVE_GTK2 */ /** * defines the Possible Player Keys */ enum KEYS { UP, DOWN, LEFT, RIGHT, SHOOT }; class Player; //! Class that creates the Keys-Options. class OrxonoxGuiKeys { private: Frame* keysFrame; Box* keysBox; Player* player1; Player* player2; Button* misc; public: OrxonoxGuiKeys (); ~OrxonoxGuiKeys (); Widget* getWidget (); }; //! Class to hold infos about a Player class Player { private: Window* pKeyWindow; Frame* pKeyFrame; Button* openButton; Button* closeButton; Box* pKeysBox; struct InputKey { Box* pKeyBox; Button* pKeyButton; OptionLabel* pKeyOLabel; }; InputKey* inputKey[10]; static Window* inputWindow; static Button* inputButton; static long keySignal; public: Player(char* player); Widget* addKey (KEYS key, char* name); Button* getOpenButton(); #ifdef HAVE_GTK2 static gint inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* widget); static gint key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey); #endif /* HAVE_GTK2 */ void setkey(KEYS key); }; #endif /* _ORXONOX_GUI_KEYS_H */