Index: trunk/src/lib/shell/shell.cc
===================================================================
--- trunk/src/lib/shell/shell.cc	(revision 5179)
+++ trunk/src/lib/shell/shell.cc	(revision 5180)
@@ -58,6 +58,4 @@
   // INPUT LINE
   this->shellInput = new ShellInput;
-  this->delayed = 0;
-  this->shellInput->setRepeatDelay(.3, .05);
   //this->commandList = new tList<ShellCommand>;
 
@@ -65,9 +63,7 @@
   this->completionList = NULL;
 
-  // EVENT-Handler subscription of '`' to all States, and all other keyboard commands to ES_SEHLL
-  EventHandler* evh = EventHandler::getInstance();
-  evh->subscribe(this, ES_ALL, SDLK_BACKQUOTE);
-  for (int i = 1; i < SDLK_LAST; i++)
-    evh->subscribe(this, ES_SHELL, i);
+  // EVENT-Handler subscription of '`' to all States.
+  EventHandler::getInstance()->subscribe(this, ES_ALL, SDLK_BACKQUOTE);
+
 }
 
@@ -85,4 +81,5 @@
 
   // delete the inputLine
+  delete this->shellInput;
 
   Shell::singletonRef = NULL;
@@ -250,5 +247,4 @@
   if (event.bPressed)
   {
-    PRINTF(5)("Shell received command %s\n", SDLKToKeyname(event.type));
     if (event.type == SDLK_BACKQUOTE)
     {
@@ -258,79 +254,7 @@
         this->deactivate();
     }
-    else if (event.type == SDLK_F1)
-      this->help();
-    else if (event.type == SDLK_F2)
-      this->debug();
-    else if (event.type == SDLK_TAB)
-      ;//this->autoComplete();
-    else if (event.type == SDLK_BACKSPACE)
-    {
-      this->delayed = this->repeatDelay;
-      this->pressedKey = SDLK_BACKSPACE;
-      this->shellInput->removeCharacters(1);
-    }
-    else if (event.type == SDLK_RETURN)
-      this->shellInput->executeCommand();
-    /*
-    else if (event.type == SDLK_UP)
-    {
-//      this->flushInputLine();
-      tIterator<char>* iterator = this->commandList->getIterator();
-      char* command = iterator->lastElement();
-      while (command)
-      {
-        if (!strcmp (command, inputLine))
-        {
-          inputLine = iterator->prevElement();
-          return;
-        }
-        command = iterator->prevElement();
-      }
-      inputLine = iterator->lastElement();
-    }
-    */
-    else if (likely(event.type < 127))
-    {
-      Uint8 *keystate = SDL_GetKeyState(NULL);
-      this->delayed = this->repeatDelay;
-      if (unlikely( keystate[SDLK_LSHIFT] || keystate[SDLK_RSHIFT] ))
-      {
-        this->pressedKey = event.type-32;
-        this->shellInput->addCharacter(event.type-32);
-      }
-      else
-      {
-        this->pressedKey = event.type;
-        this->shellInput->addCharacter(event.type);
-      }
-    }
   }
-  else // if(!event.bPressed)
-  {
-    if (this->pressedKey == event.type || (this->pressedKey == event.type - 32))
-    {
-      this->pressedKey = SDLK_FIRST;
-      this->delayed = 0.0;
-    }
-  }
-}
-
-/**
- * ticks the Shell for dt Seconds
- * @param dt the elapsed time since the last tick();
- */
-void Shell::tick(float dt)
-{
-  if (this->delayed > 0.0)
-    this->delayed -= dt;
-  else if (this->pressedKey != SDLK_FIRST )
-  {
-    this->delayed = this->repeatRate;
-    if (this->pressedKey == SDLK_BACKSPACE)
-      this->shellInput->removeCharacters(1);
-    else if (pressedKey < 127)
-      this->shellInput->addCharacter(this->pressedKey);
-  }
-}
+}
+
 /**
  * displays the Shell
@@ -365,17 +289,4 @@
 }
 
-/**
- * prints out some nice help about the Shell
- */
-void Shell::help() const
-{
-  PRINT(0)("Help for the most important Shell-commands\n");
-  PRINT(0)("F1 - HELP; F2 - DEBUG; ` - open/close shell\n");
-  PRINT(0)("input order:\n");
-  PRINT(0)("ClassName::objectName function [parameter1, [parameter2 ...]]  or\n");
-  PRINT(0)("Command [parameter]\n");
-}
-
-
 ///////////////////////
 // HELPER FUNCTIONS  //
@@ -401,6 +312,6 @@
   PRINT(3)("Debugging output to console (not this shell)\n");
 
-  if (this->pressedKey != SDLK_FIRST)
-    printf("%s::%f %f\n", SDLKToKeyname(this->pressedKey), this->delayed, this->repeatDelay);
+//   if (this->pressedKey != SDLK_FIRST)
+//     printf("%s::%f %f\n", SDLKToKeyname(this->pressedKey), this->delayed, this->repeatDelay);
 
 
Index: trunk/src/lib/shell/shell.h
===================================================================
--- trunk/src/lib/shell/shell.h	(revision 5179)
+++ trunk/src/lib/shell/shell.h	(revision 5180)
@@ -54,13 +54,10 @@
     void clear();
 
-
     // EventListener
     virtual void process(const Event &event);
 
     // Element2D-functions
-    void tick(float dt);
     virtual void draw() const;
 
-    void help() const;
     void debug() const;
 
@@ -79,21 +76,15 @@
     static Shell*            singletonRef;           //!< The singleton-reference to the only memeber of this class.
 
-    unsigned int             bufferDisplaySize;      //!< The Size of the Display-buffer, in lines (not in characters)
+    // GENERAL
+    bool                     bActive;                //!< if the shell is active;
+    unsigned int             shellHeight;            //!< The hight of the Shell in Pixels
+    unsigned int             lineSpacing;            //!< The Spacing between lines.
+    unsigned int             textSize;               //!< The size of the text.
 
     // HANDLING TEXT INPUT
     ShellInput*              shellInput;
-
-    float                    repeatRate;             //!< The Repeat-Delay.
-    float                    repeatDelay;            //!< The delay of the first Character of a given Character.
-    float                    delayed;                //!< how much of the delay is remaining.
-    int                      pressedKey;             //!< the pressed key that will be repeated.
-
-    tList<char>*             inputHistory;           //!< The history of given commands.
-
+    // BUFFER
+    unsigned int             bufferDisplaySize;      //!< The Size of the Display-buffer, in lines (not in characters)
     Text**                   bufferText;             //!< A list of stored bufferTexts for the display of the buffer
-    unsigned int             textSize;               //!< The size of the text.
-    unsigned int             lineSpacing;            //!< The Spacing between lines.
-    unsigned int             shellHeight;            //!< The hight of the Shell in Pixels
-    bool                     bActive;                //!< if the shell is active;
 
     // completion
Index: trunk/src/lib/shell/shell_input.cc
===================================================================
--- trunk/src/lib/shell/shell_input.cc	(revision 5179)
+++ trunk/src/lib/shell/shell_input.cc	(revision 5180)
@@ -18,5 +18,5 @@
 #include "shell_input.h"
 
-#include "text_engine.h"
+#include "event_handler.h"
 
 #include "shell_command.h"
@@ -25,4 +25,6 @@
 #include "compiler.h"
 #include "stdlibincl.h"
+#include "key_names.h"
+
 
 using namespace std;
@@ -40,4 +42,12 @@
   this->inputLine[0] = '\0';
   this->inputHistory = new tList<char>;
+  this->delayed = 0;
+  this->setRepeatDelay(.3, .05);
+
+  // subscribe all keyboard commands to ES_SEHLL
+  EventHandler* evh = EventHandler::getInstance();
+  for (int i = 1; i < SDLK_LAST; i++)
+    evh->subscribe(this, ES_SHELL, i);
+
 }
 
@@ -144,2 +154,95 @@
 }
 
+
+/**
+ * prints out some nice help about the Shell
+ */
+void ShellInput::help() const
+{
+  PRINT(0)("Help for the most important Shell-commands\n");
+  PRINT(0)("F1 - HELP; F2 - DEBUG; ` - open/close shell\n");
+  PRINT(0)("input order:\n");
+  PRINT(0)("ClassName::objectName function [parameter1, [parameter2 ...]]  or\n");
+  PRINT(0)("Command [parameter]\n");
+}
+
+void ShellInput::tick(float dt)
+{
+  if (this->delayed > 0.0)
+    this->delayed -= dt;
+  else if (this->pressedKey != SDLK_FIRST )
+  {
+    this->delayed = this->repeatRate;
+    if (this->pressedKey == SDLK_BACKSPACE)
+      this->removeCharacters(1);
+    else if (pressedKey < 127)
+      this->addCharacter(this->pressedKey);
+  }
+}
+
+/**
+ * listens for some event
+ * @param event the Event happened
+ */
+void ShellInput::process(const Event &event)
+{
+  if (event.bPressed)
+  {
+    PRINTF(5)("Shell received command %s\n", SDLKToKeyname(event.type));
+    if (event.type == SDLK_F1)
+      this->help();
+    else if (event.type == SDLK_F2)
+      this->debug();
+    else if (event.type == SDLK_TAB)
+      ;//this->autoComplete();
+    else if (event.type == SDLK_BACKSPACE)
+    {
+      this->delayed = this->repeatDelay;
+      this->pressedKey = SDLK_BACKSPACE;
+      this->removeCharacters(1);
+    }
+    else if (event.type == SDLK_RETURN)
+      this->executeCommand();
+    /*
+    else if (event.type == SDLK_UP)
+    {
+//      this->flushInputLine();
+    tIterator<char>* iterator = this->commandList->getIterator();
+    char* command = iterator->lastElement();
+    while (command)
+    {
+    if (!strcmp (command, inputLine))
+    {
+    inputLine = iterator->prevElement();
+    return;
+  }
+    command = iterator->prevElement();
+  }
+    inputLine = iterator->lastElement();
+  }
+    */
+    else if (likely(event.type < 127))
+    {
+      Uint8 *keystate = SDL_GetKeyState(NULL);
+      this->delayed = this->repeatDelay;
+      if (unlikely( keystate[SDLK_LSHIFT] || keystate[SDLK_RSHIFT] ))
+      {
+        this->pressedKey = event.type-32;
+        this->addCharacter(event.type-32);
+      }
+      else
+      {
+        this->pressedKey = event.type;
+        this->addCharacter(event.type);
+      }
+    }
+  }
+  else // if(!event.bPressed)
+  {
+    if (this->pressedKey == event.type || (this->pressedKey == event.type - 32))
+    {
+      this->pressedKey = SDLK_FIRST;
+      this->delayed = 0.0;
+    }
+  }
+}
Index: trunk/src/lib/shell/shell_input.h
===================================================================
--- trunk/src/lib/shell/shell_input.h	(revision 5179)
+++ trunk/src/lib/shell/shell_input.h	(revision 5180)
@@ -8,4 +8,5 @@
 
 #include "text_engine.h"
+#include "event_listener.h"
 
 // FORWARD DECLARATION
@@ -14,5 +15,5 @@
 
 //! A class for ...
-class ShellInput : public Text {
+class ShellInput : public Text,  public EventListener {
 
  public:
@@ -28,6 +29,10 @@
   void setRepeatDelay(float repeatDelay, float repeatRate);
   bool executeCommand();
+  void help() const;
   const char* getInputString() const { return this->inputLine; };
 
+
+  virtual void tick(float dt);
+  virtual void process(const Event &event);
 
  private:
