Index: /code/branches/chat2/data/gui/layouts/ChatBox-inputonly.layout
===================================================================
--- /code/branches/chat2/data/gui/layouts/ChatBox-inputonly.layout	(revision 6875)
+++ /code/branches/chat2/data/gui/layouts/ChatBox-inputonly.layout	(revision 6876)
@@ -8,6 +8,7 @@
         <Window Type="MenuWidgets/Editbox" Name="orxonox/ChatBox-inputonly/input" >
             <Property Name="Text" Value="" />
+            <Property Name="Font" Value="Monofur-10" />
             <Property Name="AlwaysOnTop" Value="True" />
-            <Property Name="MaxTextLength" Value="1073741823" />
+            <Property Name="MaxTextLength" Value="12981298" />
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
             <Property Name="UnifiedAreaRect" Value="{{0.02,0},{0,5},{0.98,0},{0,30}}" />
Index: /code/branches/chat2/data/gui/layouts/ChatBox.layout
===================================================================
--- /code/branches/chat2/data/gui/layouts/ChatBox.layout	(revision 6875)
+++ /code/branches/chat2/data/gui/layouts/ChatBox.layout	(revision 6876)
@@ -13,4 +13,5 @@
             <Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.03,0},{0.6,0},{0.69375,0}}" />
             <Window Type="MenuWidgets/Listbox" Name="orxonox/ChatBox/history" >
+                <Property Name="Font" Value="Monofur-10" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="UnifiedAreaRect" Value="{{0.02,0},{0.078,0},{0.98,0},{1,-30}}" />
@@ -18,4 +19,5 @@
             <Window Type="MenuWidgets/Editbox" Name="orxonox/ChatBox/input" >
                 <Property Name="Text" Value="" />
+                <Property Name="Font" Value="Monofur-10" />
                 <Property Name="MaxTextLength" Value="1073741823" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
Index: /code/branches/chat2/data/gui/schemes/OrxonoxGUIScheme.scheme
===================================================================
--- /code/branches/chat2/data/gui/schemes/OrxonoxGUIScheme.scheme	(revision 6875)
+++ /code/branches/chat2/data/gui/schemes/OrxonoxGUIScheme.scheme	(revision 6876)
@@ -6,3 +6,4 @@
     <Font Name="BlueHighway-10" Filename="bluehighway-10.font" />
     <Font Name="BlueHighway-8"  Filename="bluehighway-8.font"  />
+    <Font Name="Monofur-10"     Filename="Monofur-10.font" />
 </GUIScheme>
Index: /code/branches/chat2/src/orxonox/ChatInputHandler.cc
===================================================================
--- /code/branches/chat2/src/orxonox/ChatInputHandler.cc	(revision 6875)
+++ /code/branches/chat2/src/orxonox/ChatInputHandler.cc	(revision 6876)
@@ -44,4 +44,6 @@
   /* singleton */
   ManageScopedSingleton( ChatInputHandler, ScopeID::Graphics, false );
+
+  /* add commands to console */
   SetConsoleCommandAlias( ChatInputHandler, activate_static, "startchat",
     true );
@@ -49,5 +51,4 @@
     "startchat_small", true );
 
-
   /* constructor */
   ChatInputHandler::ChatInputHandler()
@@ -58,4 +59,5 @@
     /* create necessary objects */
     this->inpbuf = new InputBuffer();
+    this->disp_offset = 0;
     assert( this->inpbuf != NULL );
 
@@ -133,9 +135,25 @@
     InputManager::getInstance().leaveState("chatinput");
 
-    /* MARK add un-spawning of chat widget stuff here. */
+    /* un-spawning of chat widget stuff */
     GUIManager::getInstance().hideGUI( "ChatBox" );
     GUIManager::getInstance().hideGUI( "ChatBox-inputonly" );
   }
 
+  void ChatInputHandler::sub_adjust_dispoffset( int maxlen, int cursorpos, int inplen )
+  {
+    /* already start offsetting 5 characters before end */
+    if( cursorpos+5 > maxlen )
+    { 
+      /* always stay 5 characters ahead of end, looks better */
+      ((disp_offset = cursorpos-maxlen+5) >= 0) ? 1 : disp_offset = 0;
+
+      /* enforce visibility of cursor */
+      (disp_offset > cursorpos ) ? disp_offset = 0 : 1;
+    }
+     
+    /* make sure we don't die at substr */
+    if( inplen <= disp_offset ) disp_offset = 0;
+  }
+
   /* callbacks for InputBuffer */
   void ChatInputHandler::inputChanged()
@@ -143,16 +161,32 @@
     /* update the cursor and the window */
     std::string raw = this->inpbuf->get();
+    int cursorpos = this->inpbuf->getCursorPosition();
     
     /* get string before cursor */
-    std::string left = raw.substr( 0, this->inpbuf->getCursorPosition() );
+    std::string left = raw.substr( 0, cursorpos );
 
     /* see if there's a string after the cursor */
     std::string right = "";
     if( raw.length() >= left.length()+1 )
-      right = raw.substr( this->inpbuf->getCursorPosition() );
+      right = raw.substr( cursorpos );
       
     /* set the text */
-    this->input->setProperty( "Text", left + "|" + right );
-    this->inputonly->setProperty( "Text", left + "|" + right );
+    std::string assembled = "$ " + left + "|" + right;
+
+    /* adjust curser position - magic number 5 for font width */
+    sub_adjust_dispoffset( (this->input->getUnclippedInnerRect().getWidth()/6), 
+      cursorpos, assembled.length() );
+    this->input->setProperty( "Text", assembled.substr( disp_offset ) );
+
+    /* reset display offset */
+    disp_offset = 0;
+
+    /* adjust curser position - magic number 5 for font width */
+    sub_adjust_dispoffset( (this->inputonly->getUnclippedInnerRect().getWidth()/6), 
+      cursorpos, assembled.length() );
+    this->inputonly->setProperty( "Text", assembled.substr( disp_offset) );
+
+    /* reset display offset */
+    disp_offset = 0;
   }
 
Index: /code/branches/chat2/src/orxonox/ChatInputHandler.h
===================================================================
--- /code/branches/chat2/src/orxonox/ChatInputHandler.h	(revision 6875)
+++ /code/branches/chat2/src/orxonox/ChatInputHandler.h	(revision 6876)
@@ -62,4 +62,5 @@
        */
       InputBuffer *inpbuf;
+      int disp_offset, width;
 
       /** input state */
@@ -68,4 +69,7 @@
       /** setup input buffer, the constructor calls this */
       void configureInputBuffer();
+
+      /** adjust display offset depending on cursor position */
+      void sub_adjust_dispoffset( int maxlen, int cursorpos, int inplen );
 
       /* singleton pointer */
