Index: orxonox/trunk/gui/orxonox_gui.h
===================================================================
--- orxonox/trunk/gui/orxonox_gui.h	(revision 3155)
+++ orxonox/trunk/gui/orxonox_gui.h	(revision 3156)
@@ -1,5 +1,5 @@
 /*!
  \file orxonox_gui.h
- \brief Contains all Widgets and the Creation of the Gui
+ \brief Creation of the Gui
 */
 
Index: orxonox/trunk/gui/orxonox_gui_gtk.cc
===================================================================
--- orxonox/trunk/gui/orxonox_gui_gtk.cc	(revision 3155)
+++ orxonox/trunk/gui/orxonox_gui_gtk.cc	(revision 3156)
@@ -102,7 +102,7 @@
     \brief Connect any signal to any given Sub-widget
 */
-void Widget::connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *))
-{
-  g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), NULL);
+gulong Widget::connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *))
+{
+  return g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), NULL);
 }
 
@@ -110,7 +110,7 @@
    \brief Connect a signal with additionally passing the whole Object
 */
-void Widget::connectSignal (char* event, gint (*signal)( GtkWidget*, Widget *))
-{
-g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), this);
+gulong Widget::connectSignal (char* event, gint (*signal)( GtkWidget*, Widget *))
+{
+  return g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), this);
 }
 
@@ -118,7 +118,7 @@
    \brief Connect a signal with additionally passing a whole external Object
 */
-void Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *))
-{
-  g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj);
+gulong Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *))
+{
+  return g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj);
 }
 
@@ -126,7 +126,12 @@
    \brief Connect a signal with additionally passing a whole external Object
 */
-void Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *))
-{
-  g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj);
+gulong Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *))
+{
+  return g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj);
+}
+
+void Widget::disconnectSignal (gulong signalID)
+{
+  g_signal_handler_disconnect (G_OBJECT (this->widget), signalID);
 }
 
@@ -374,6 +379,6 @@
 {
   static_cast<Window*>(window)->close();
-  
-}
+}
+
 /**
  * Quits the orxonox_GUI.
@@ -852,8 +857,33 @@
    \brief Redraws the widget
    Example: see void CheckButton::redraw ()
- */
+*/
 void Menu::redraw ()
 {
   gtk_option_menu_set_history (GTK_OPTION_MENU (widget), value);
+}
+
+OptionLabel::OptionLabel(char* text)
+{
+  init();
+  setTitle(text);
+}
+
+void OptionLabel::init(void)
+{
+  isOption = 4;
+
+  static_cast<Option*>(this)->init();
+
+  widget = gtk_label_new ("");
+}
+
+void OptionLabel::setTitle(char* title)
+{
+  gtk_label_set_text (GTK_LABEL (widget), title);
+}
+
+void OptionLabel::redraw(void)
+{
+  
 }
 
@@ -862,5 +892,5 @@
    You migth consider adding Label::setTitle with this.
 */
-Label:: Label ()
+Label::Label ()
 {
   this->init();
Index: orxonox/trunk/gui/orxonox_gui_gtk.h
===================================================================
--- orxonox/trunk/gui/orxonox_gui_gtk.h	(revision 3155)
+++ orxonox/trunk/gui/orxonox_gui_gtk.h	(revision 3156)
@@ -1,2 +1,6 @@
+/*!
+ \file orxonox_gui_gtk.h
+ \brief Contains all th different Widgets.
+*/
 
 #ifndef _ORXONOX_GUI_GTK_H
@@ -34,8 +38,9 @@
   enum option { containerType = -2, boxType = -1, nothingType = 0, boolType = 1, intType = 2}; 
   char* label; //!< The name of the Widget. Some do display it, Options need it to save;
-  void connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *));
-  void connectSignal (char* event, gint (*signal)(GtkWidget*, Widget *));
-  void connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *));
-  void connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *));
+  gulong connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *));
+  gulong connectSignal (char* event, gint (*signal)(GtkWidget*, Widget *));
+  gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *));
+  gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *));
+  void disconnectSignal (gulong signalID);
   void show ();
   void hide ();
@@ -178,5 +183,5 @@
   char* flag_name_short; //!< like flag_name but shorter
   int default_value; //!< A default value is good, for hiding a option if it is not needed. (hidden if value == default_value)
-  bool saveable;
+  bool saveable;  //! Options can be Saved.
 
   void setFlagName (char* flagname, int defaultvalue);
@@ -252,4 +257,15 @@
 };
 
+//! A CharLabel is a simple Label, that holds a char*, and will be updated, if changed.
+class OptionLabel : public Option
+{
+ public:
+  OptionLabel(char* text);
+  void init(void);
+
+  void setTitle(char* title);
+  void redraw();
+};
+
 //! A label is a Widget, that displays a text
 class Label : public Widget
@@ -264,4 +280,5 @@
 };
 
+
 //gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data);
 
Index: orxonox/trunk/gui/orxonox_gui_keys.cc
===================================================================
--- orxonox/trunk/gui/orxonox_gui_keys.cc	(revision 3155)
+++ orxonox/trunk/gui/orxonox_gui_keys.cc	(revision 3156)
@@ -80,18 +80,28 @@
   openButton->connectSignal("button_press_event", pKeyWindow, Window::windowOpen);
 
+  inputWindow = new Window("inputWindow");
+
+  inputButton = new Button ("test");
+  inputButton->connectSignal ("button_press_event", inputWindow, Window::windowClose);
+  inputWindow->fill (inputButton);
+  inputWindow->connectSignal("destroy", inputWindow, Window::windowClose);
+  inputWindow->connectSignal("delete_event", inputWindow, Window::windowClose);
+
 }
 
 Widget* Player::addKey (KEYS key, char* name)
 {
-  pKeyBox[key] = new Box();
-  pKeyLabel[key] = new Label (name);
-  pKeyButton[key] = new Button(name);
-  pKeyButton[key]->saveable = true;
+  inputKey[key] = new InputKey;
+  inputKey[key]->pKeyBox = new Box();
+  inputKey[key]->pKeyButton = new Button(name);
+  inputKey[key]->pKeyOLabel = new OptionLabel (name);
+  inputKey[key]->pKeyOLabel->saveable = true;
   
-  pKeyButton[key]->connectSignal("key_press_event", pKeyButton[key], key_cb);
-  
-  pKeyBox[key]->fill(pKeyLabel[key]);
-  pKeyBox[key]->fill(pKeyButton[key]);
-  return pKeyBox[key];
+  //inputKey[key]->pKeyButton->connectSignal("key_press_event", inputKey[key]->pKeyButton, key_cb);
+  inputKey[key]->pKeyButton->connectSignal("button_press_event", inputKey[key], inputWindowEvent);
+
+  inputKey[key]->pKeyBox->fill(inputKey[key]->pKeyButton);
+  inputKey[key]->pKeyBox->fill(inputKey[key]->pKeyOLabel);
+  return inputKey[key]->pKeyBox;
 }
 
@@ -105,4 +115,15 @@
 {
   cout << "setting up Key: "<< key <<endl;
+}
+
+Window* Player::inputWindow = NULL;
+Button* Player::inputButton = NULL;
+long Player::keySignal = 0;
+
+gint Player::inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* inputKey)
+{
+  inputButton->setTitle("teste");
+  keySignal = inputButton->connectSignal("key_press_event", inputKey, key_cb);
+  inputWindow->open();
 }
 
@@ -114,118 +135,127 @@
    \returns Nothing
 */
-gint Player::key_cb(GtkWidget* w, GdkEventKey* event, void* widget)
-{
-  Button* button = static_cast<Button*>(widget);
-
-  switch(event->keyval) {
-  case GDK_Up:
-    printf("Up arrow key!\n");
-    button->setTitle("up");
-    break;
-  case GDK_Down:
-    printf("Down arrow key!\n");
-    button->setTitle("down");
-    break;
-  case GDK_Left:
-    printf("Left arrow key!\n");
-    button->setTitle("left");
-    break;
-  case GDK_Right:
-    printf("Right arrow key!\n");
-    button->setTitle("right");
-    break;
-
-  case GDK_space:
-    printf("Space Pressed.\n");
-    button->setTitle("space");
-    break;
-
-  case 65293:
-    printf("Enter Pressed\n");
-    button->setTitle("enter");
-    break;
-
-    // Special Keys //
-  case GDK_Shift_L:
-    printf("Left Shift!\n");
-    button->setTitle("l_shift");
-    break;
-  case GDK_Shift_R:
-    printf("Right Shift!\n");
-    button->setTitle("r_shift");
-    break;
-  case GDK_Control_L:
-    printf("Left Control!\n");
-    button->setTitle("l_ctrl");
-    break;
-  case GDK_Control_R:
-    printf("Right Control!\n");
-    button->setTitle("r_ctrl");
-    break;
-  case GDK_Alt_L:
-    printf("Left Alt!\n");
-    button->setTitle("l_alt");
-    break;
-  case GDK_Alt_R:
-    printf("Rigth Alt!\n");
-    button->setTitle("r_alt");
-    break;
-    // FXX KEYS //
-  case GDK_F1:
-    printf("F1!\n");
-    button->setTitle("f1");
-    break;
-  case GDK_F2:
-    printf("F2!\n");
-    button->setTitle("f2");
-    break;
-  case GDK_F3:
-    printf("F3!\n");
-    button->setTitle("f3");
-    break;
-  case GDK_F4:
-    printf("F4!\n");
-    button->setTitle("f4");
-    break;
-  case GDK_F5:
-    printf("F5!\n");
-    button->setTitle("f5");
-    break;
-  case GDK_F6:
-    printf("F6!\n");
-    button->setTitle("f6");
-    break;
-  case GDK_F7:
-    printf("F7!\n");
-    button->setTitle("f7");
-    break;
-  case GDK_F8:
-    printf("F8!\n");
-    button->setTitle("f8");
-    break;
-  case GDK_F9:
-    printf("F9\n");
-    button->setTitle("f9");
-    break;
-  case GDK_F10:
-    printf("F10!\n");
-    button->setTitle("f10");
-    break;
-  case GDK_F11:
-    printf("F11!\n");
-    button->setTitle("f11");
-    break;
-  case GDK_F12:
-    printf("F12!\n");
-    button->setTitle("f12");
-    break;
-
-
-  default:
-    char* tmp;
-    sprintf(tmp, "%c", event->keyval);
-    printf ("other key %s \n", tmp);
-    button->setTitle(tmp);
-    break;
-  }
-}
+gint Player::key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey)
+{
+  InputKey* inputkey = (InputKey*) inputKey;
+  char title [20];
+
+  switch(event->keyval) 
+    {
+    case GDK_Up:
+      printf("Up arrow key!\n");
+      sprintf(title, "%s", "up");
+      break;
+    case GDK_Down:
+      printf("Down arrow key!\n");
+      sprintf(title, "%s", "down");
+      break;
+    case GDK_Left:
+      printf("Left arrow key!\n");
+      sprintf(title, "%s", "left");
+      break;
+    case GDK_Right:
+      printf("Right arrow key!\n");
+      sprintf(title, "%s", "right");
+      break;
+      
+    case GDK_space:
+      printf("Space Pressed.\n");
+      sprintf(title, "%s", "space");
+      break;
+      
+      /*  case GDK_escape:
+	  printf("Esc Pressed.\n");
+	  sprintf(title, "%s", "esc");
+      */
+    case 65293:
+      printf("Enter Pressed\n");
+      sprintf(title, "%s", "enter");
+      break;
+      
+      // Special Keys //
+    case GDK_Shift_L:
+      printf("Left Shift!\n");
+      sprintf(title, "%s", "l_shift");
+      break;
+    case GDK_Shift_R:
+      printf("Right Shift!\n");
+      sprintf(title, "%s", "r_shift");
+      break;
+    case GDK_Control_L:
+      printf("Left Control!\n");
+      sprintf(title, "%s", "l_ctrl");
+      break;
+    case GDK_Control_R:
+      printf("Right Control!\n");
+      sprintf(title, "%s", "r_ctrl");
+      break;
+    case GDK_Alt_L:
+      printf("Left Alt!\n");
+      sprintf(title, "%s", "l_alt");
+      break;
+    case GDK_Alt_R:
+      printf("Rigth Alt!\n");
+      sprintf(title, "%s", "r_alt");
+      break;
+      // FXX KEYS //
+    case GDK_F1:
+      printf("F1!\n");
+      sprintf(title, "%s", "f1");
+      break;
+    case GDK_F2:
+      printf("F2!\n");
+      sprintf(title, "%s", "f2");
+      break;
+    case GDK_F3:
+      printf("F3!\n");
+      sprintf(title, "%s", "f3");
+      break;
+    case GDK_F4:
+      printf("F4!\n");
+      sprintf(title, "%s", "f4");
+      break;
+    case GDK_F5:
+      printf("F5!\n");
+      sprintf(title, "%s", "f5");
+      break;
+    case GDK_F6:
+      printf("F6!\n");
+      sprintf(title, "%s", "f6");
+      break;
+    case GDK_F7:
+      printf("F7!\n");
+      sprintf(title, "%s", "f7");
+      break;
+    case GDK_F8:
+      printf("F8!\n");
+      sprintf(title, "%s", "f8");
+      break;
+    case GDK_F9:
+      printf("F9\n");
+      sprintf(title, "%s", "f9");
+      break;
+    case GDK_F10:
+      printf("F10!\n");
+      sprintf(title, "%s", "f10");
+      break;
+    case GDK_F11:
+      printf("F11!\n");
+      sprintf(title, "%s", "f11");
+      break;
+    case GDK_F12:
+      printf("F12!\n");
+      sprintf(title, "%s", "f12");
+      break;
+      
+      
+    default:
+      char* tmp;
+      sprintf(tmp, "%c", event->keyval);
+      printf ("other key %s \n", tmp);
+      sprintf(title, "%s", tmp);
+      break;
+    }
+  inputkey->pKeyOLabel->setTitle (title);
+  inputButton->disconnectSignal(keySignal);
+  inputWindow->close();
+}
Index: orxonox/trunk/gui/orxonox_gui_keys.h
===================================================================
--- orxonox/trunk/gui/orxonox_gui_keys.h	(revision 3155)
+++ orxonox/trunk/gui/orxonox_gui_keys.h	(revision 3156)
@@ -43,9 +43,16 @@
   Box* pKeysBox;
   
-  Box* pKeyBox[10];
-  Button* pKeyButton[10];
-  Label* pKeyLabel[10];
+  struct InputKey
+  {
+    Box* pKeyBox;
+    Button* pKeyButton;
+    OptionLabel* pKeyOLabel;
+  };
 
+  InputKey* inputKey[10];
 
+  static Window* inputWindow;
+  static Button* inputButton;
+  static long keySignal;
  public:
   Player(char* player);
@@ -55,5 +62,6 @@
   Button* getOpenButton();
 
-  static gint key_cb(GtkWidget* w, GdkEventKey* event, void* widget);
+  static gint inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* widget);
+  static gint key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey);
   void setkey(KEYS key);
   
