Index: /orxonox/branches/chris/src/command_node.cc
===================================================================
--- /orxonox/branches/chris/src/command_node.cc	(revision 2066)
+++ /orxonox/branches/chris/src/command_node.cc	(revision 2066)
@@ -0,0 +1,178 @@
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Christian Meyer
+   co-programmer: ...
+*/
+
+
+#include "command_node.h"
+#include "keynames.h"
+#include "ini_parser.h"
+
+#include <stdio.h>
+#include <strings.h>
+
+using namespace std;
+
+CommandNode::CommandNode (int ID)
+{
+	bound = new List<WorldEntity>();
+	aliases = NULL;
+	netID = ID;
+	bLocalInput = false;
+}
+
+CommandNode::CommandNode (char* filename = DEFAULT_KEYBIND_FILE)
+{
+	bLocalInput = true;
+	netID = 0;
+	bound = new List<WorldEntity>();
+	load_bindings (filename);
+}
+
+CommandNode::~CommandNode ()
+{
+	if( aliases != NULL) free (aliases);
+	if( bound != NULL) delete bound;
+}
+
+void CommandNode::load_bindings (char* filename)
+{
+	FILE* stream;
+	
+	if( filename == NULL) filename = DEFAULT_KEYBIND_FILE;
+	
+		// remove old bindings if present
+	if( aliases != NULL)
+	{
+		free (aliases);
+		aliases = NULL;
+	}
+			
+		// create parser
+	IniParser parser (filename);
+	if( parser.get_section ("Bindings") == -1)
+	{
+		printf("Could not find key bindings in %s\n", filename);
+		return;
+	}
+			// allocate empty lookup table
+	aliases = (KeyBindings*) calloc (1, sizeof (KeyBindings));
+	
+	char namebuf[256];
+	char valuebuf[256];
+	int* index;
+
+	while( parser.next_var (namebuf, valuebuf) != -1)
+	{
+		index = name_to_index (namebuf);
+		switch( index[0])
+		{
+			case 0:
+				strcpy (aliases->keys[index[1]], valuebuf);
+				break;
+			case 1:
+				strcpy (aliases->buttons[index[1]], valuebuf);
+				break;
+			default:
+				break;
+		}
+	}
+}
+
+void CommandNode::bind (WorldEntity* entity)
+{
+	bound->add (entity, LIST_ADD_NEXT, true);
+}
+
+void CommandNode::unbind (WorldEntity* entity)
+{
+	bound->remove (entity, LIST_FIND_FW);
+}
+
+int* CommandNode::name_to_index (char* name)
+{
+	coord[0] = -1;
+	if( (coord[1] = keyname_to_SDLK (name)) != -1) coord[0] = 0;
+	if( (coord[1] = buttonname_to_SDLB (name)) != -1) coord[0] = 1;
+	return coord;
+}
+
+void CommandNode::process ()
+{
+	if( bLocalInput) process_local ();
+	else process_network ();
+}
+
+void CommandNode::process_local ()
+{
+	SDL_Event event;
+	Command cmd;
+	
+	while( SDL_PollEvent (&event))
+	{
+		switch( event.type)
+		{
+			case SDL_KEYDOWN:
+				strcpy (cmd.cmd, aliases->keys[event.key.keysym.sym]);
+				cmd.bUp = false;
+				if( strlen (cmd.cmd) > 0) relay (&cmd);
+				break;
+			case SDL_KEYUP:
+				strcpy( cmd.cmd, aliases->keys[event.key.keysym.sym]);
+				cmd.bUp = true;
+				if( strlen (cmd.cmd) > 0) relay (&cmd);
+				break;
+			case SDL_MOUSEMOTION:
+				strcpy( cmd.cmd, "cursor");
+				cmd.x = event.motion.x;
+				cmd.y = event.motion.y;
+				cmd.xrel = event.motion.xrel;
+				cmd.yrel = event.motion.yrel;
+				break;
+			case SDL_MOUSEBUTTONUP:
+				strcpy( cmd.cmd, aliases->buttons[event.button.button]);
+				cmd.bUp = true;
+				if( strlen (cmd.cmd) > 0) relay (&cmd);
+				break;
+			case SDL_MOUSEBUTTONDOWN:
+				strcpy( cmd.cmd, aliases->buttons[event.button.button]);
+				cmd.bUp = false;
+				if( strlen (cmd.cmd) > 0) relay (&cmd);
+				break;
+			case SDL_JOYAXISMOTION:
+			case SDL_JOYBALLMOTION:
+			case SDL_JOYHATMOTION:
+			case SDL_JOYBUTTONDOWN:
+			case SDL_JOYBUTTONUP:
+				break;
+			default:
+					// TO DO: Send other events to orxonox sysevent handler
+				break;
+		}
+	}
+}
+
+void CommandNode::process_network ()
+{
+
+}
+
+void CommandNode::relay (Command* cmd)
+{
+	List<WorldEntity>* plist = bound;
+	
+	while( (plist = plist->get_next()) != NULL)
+	{
+		(plist->get_object())->command (cmd);
+	}
+}
Index: /orxonox/branches/chris/src/command_node.h
===================================================================
--- /orxonox/branches/chris/src/command_node.h	(revision 2066)
+++ /orxonox/branches/chris/src/command_node.h	(revision 2066)
@@ -0,0 +1,48 @@
+/*!
+    \file command_node.h
+    \brief Parses keyboard, mouse and remote input
+    
+    Contains methods to parse remote and local input and handles sending of input to remote CommandNodes
+*/
+
+#ifndef COMMAND_NODE_H
+#define COMMAND_NODE_H
+
+#include "stdincl.h"
+
+#define N_STD_KEYS SDLK_LAST
+#define N_BUTTONS 6
+#define DEFAULT_KEYBIND_FILE "default.ini"
+
+typedef struct
+{
+	char keys[N_STD_KEYS][CMD_LENGHT];
+	char buttons[N_BUTTONS][CMD_LENGHT];
+} KeyBindings;
+
+class CommandNode {
+ private:
+ 	bool bLocalInput;
+ 	int netID;
+	KeyBindings* aliases;
+	List<WorldEntity>* bound;
+	int coord[2];
+	
+	void relay (Command* cmd);
+	int* name_to_index (char* name);
+	void process_local ();
+	void process_network ();
+	void send_over_networ();
+	
+ public:
+  CommandNode (int ID);
+  CommandNode (char* filename);
+  ~CommandNode ();
+  
+  void load_bindings (char* filename);
+  void bind (WorldEntity* entity);
+  void unbind (WorldEntity* entity);
+  void process ();
+};
+
+#endif
Index: /orxonox/branches/chris/src/ini_parser.cc
===================================================================
--- /orxonox/branches/chris/src/ini_parser.cc	(revision 2065)
+++ /orxonox/branches/chris/src/ini_parser.cc	(revision 2066)
@@ -17,7 +17,4 @@
 #include "ini_parser.h"
 
-#include <stdio.h>
-#include <strings.h>
-
 using namespace std;
 
@@ -26,5 +23,5 @@
 	stream = NULL;
 	bInSection = false;
-	openFile (filename);
+	open_file (filename);
 }
 
@@ -34,5 +31,5 @@
 }
 
-int IniParser::openFile( char* filename)
+int IniParser::open_file( char* filename)
 {
 	if( filename == NULL) return -1;
@@ -47,5 +44,5 @@
 }
 
-int IniParser::getSection( char* section)
+int IniParser::get_section( char* section)
 {
 	bInSection = false;
@@ -80,5 +77,5 @@
 }
 
-int IniParser::nextVar( char* name, char* value)
+int IniParser::next_var( char* name, char* value)
 {
 	if( stream == NULL)
@@ -114,13 +111,13 @@
 }
 
-char* IniParser::getVar( char* name, char* section, char* defvalue = "")
+char* IniParser::get_var( char* name, char* section, char* defvalue = "")
 {
 	strcpy (internbuf, defvalue);
-	if( getSection (section) == -1) return internbuf;
+	if( get_section (section) == -1) return internbuf;
 	
 	char namebuf[PARSELINELENGHT];
 	char valuebuf[PARSELINELENGHT];
 	
-	while( nextVar (namebuf, valuebuf) != -1)
+	while( next_var (namebuf, valuebuf) != -1)
 	{
 		if( !strcmp (name, namebuf))
Index: /orxonox/branches/chris/src/ini_parser.h
===================================================================
--- /orxonox/branches/chris/src/ini_parser.h	(revision 2065)
+++ /orxonox/branches/chris/src/ini_parser.h	(revision 2066)
@@ -9,5 +9,7 @@
 #define INI_PARSER_H
 
-#include "stdincl.h"
+#include <stdio.h>
+#include <strings.h>
+#include <stdlib.h>
 
 #define PARSELINELENGHT 512
@@ -23,8 +25,8 @@
   ~IniParser ();
   
-  char* getVar( char* name, char* section, char* defvalue);
-	int openFile( char* name);
-  int getSection( char* section);
-  int nextVar( char* name, char* value);
+  char* get_var( char* name, char* section, char* defvalue);
+	int open_file( char* name);
+  int get_section( char* section);
+  int next_var( char* name, char* value);
 };
 
Index: /orxonox/branches/chris/src/keynames.cc
===================================================================
--- /orxonox/branches/chris/src/keynames.cc	(revision 2066)
+++ /orxonox/branches/chris/src/keynames.cc	(revision 2066)
@@ -0,0 +1,314 @@
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Christian Meyer
+   co-programmer: ...
+*/
+
+#include "keynames.h"
+
+#include <strings.h>
+
+using namespace std;
+
+int buttonname_to_SDLB( char* name)
+{
+	if( !strcmp (name, "BUTTON_LEFT")) return SDL_BUTTON_LEFT;
+	if( !strcmp (name, "BUTTON_MIDDLE")) return SDL_BUTTON_MIDDLE;
+	if( !strcmp (name, "BUTTON_RIGHT")) return SDL_BUTTON_RIGHT;
+	if( !strcmp (name, "BUTTON_WHEELUP")) return SDL_BUTTON_WHEELUP;
+	if( !strcmp (name, "BUTTON_WHEELDOWN")) return SDL_BUTTON_WHEELDOWN;
+	return -1;
+}
+
+char* SDLB_to_buttonname( int button)
+{
+	if( button == SDL_BUTTON_LEFT)) return "BUTTON_LEFT";
+	if( button == BUTTON_MIDDLE)) return "BUTTON_MIDDLE";
+	if( button == BUTTON_RIGHT)) return "BUTTON_RIGHT";
+	if( button == BUTTON_WHEELUP)) return "BUTTON_WHEELUP";
+	if( button == BUTTON_WHEELDOWN)) return "BUTTON_WHEELDOWN";
+	return -1;
+}
+
+int keyname_to_SDLK( char* name)
+{
+	if( !strcmp (name, "BACKSPACE")) return SDLK_BACKSPACE;
+	if( !strcmp (name, "TAB")) return SDLK_TAB;
+	if( !strcmp (name, "CLEAR")) return SDLK_CLEAR;
+	if( !strcmp (name, "RETURN")) return SDLK_RETURN;
+	if( !strcmp (name, "ESCAPE")) return SDLK_ESCAPE;
+	if( !strcmp (name, "EXCLAIM")) return SDLK_EXCLAIM;
+	if( !strcmp (name, "QUOTEDBL")) return SDLK_QUOTEDBL;
+	if( !strcmp (name, "HASH")) return SDLK_HASH;
+	if( !strcmp (name, "PAUSE")) return SDLK_PAUSE;
+	if( !strcmp (name, "DOLLAR")) return SDLK_DOLLAR;
+	if( !strcmp (name, "AMPERSAND")) return SDLK_AMPERSAND;
+	if( !strcmp (name, "QUOTE")) return SDLK_QUOTE;
+	if( !strcmp (name, "LEFTPAREN")) return SDLK_LEFTPAREN;
+	if( !strcmp (name, "RIGHTPAREN")) return SDLK_RIGHTPAREN;
+	if( !strcmp (name, "ASTERISK")) return SDLK_ASTERISK;
+	if( !strcmp (name, "PLUS")) return SDLK_PLUS;
+	if( !strcmp (name, "COMMA")) return SDLK_COMMA;
+	if( !strcmp (name, "MINUS")) return SDLK_MINUS;
+	if( !strcmp (name, "PERIOD")) return SDLK_PERIOD;
+	if( !strcmp (name, "SLASH")) return SDLK_SLASH;
+	if( !strcmp (name, "0")) return SDLK_0;
+	if( !strcmp (name, "1")) return SDLK_1;
+	if( !strcmp (name, "2")) return SDLK_2;
+	if( !strcmp (name, "3")) return SDLK_3;
+	if( !strcmp (name, "4")) return SDLK_4;
+	if( !strcmp (name, "5")) return SDLK_5;
+	if( !strcmp (name, "6")) return SDLK_6;
+	if( !strcmp (name, "7")) return SDLK_7;
+	if( !strcmp (name, "8")) return SDLK_8;
+	if( !strcmp (name, "9")) return SDLK_9;
+	if( !strcmp (name, "COLON")) return SDLK_COLON;
+	if( !strcmp (name, "SEMICOLON")) return SDLK_SEMICOLON;
+	if( !strcmp (name, "LESS")) return SDLK_LESS;
+	if( !strcmp (name, "EQUALS")) return SDLK_EQUALS;
+	if( !strcmp (name, "GREATER")) return SDLK_GREATER;
+	if( !strcmp (name, "QUESTION")) return SDLK_QUESTION;
+	if( !strcmp (name, "AT")) return SDLK_AT;
+	if( !strcmp (name, "LEFTBRACKET")) return SDLK_LEFTBRACKET;
+	if( !strcmp (name, "BACKSLASH")) return SDLK_BACKSLASH;
+	if( !strcmp (name, "RIGHTBRACKET")) return SDLK_RIGHTBRACKET;
+	if( !strcmp (name, "CARET")) return SDLK_CARET;
+	if( !strcmp (name, "UNDERSCORE")) return SDLK_UNDERSCORE;
+	if( !strcmp (name, "BACKQUOTE")) return SDLK_BACKQUOTE;
+	if( !strcmp (name, "a")) return SDLK_a;
+	if( !strcmp (name, "b")) return SDLK_b;
+	if( !strcmp (name, "c")) return SDLK_c;
+	if( !strcmp (name, "d")) return SDLK_d;
+	if( !strcmp (name, "e")) return SDLK_e;
+	if( !strcmp (name, "f")) return SDLK_f;
+	if( !strcmp (name, "g")) return SDLK_g;
+	if( !strcmp (name, "h")) return SDLK_h;
+	if( !strcmp (name, "i")) return SDLK_i;
+	if( !strcmp (name, "j")) return SDLK_j;
+	if( !strcmp (name, "k")) return SDLK_k;
+	if( !strcmp (name, "l")) return SDLK_l;
+	if( !strcmp (name, "m")) return SDLK_m;
+	if( !strcmp (name, "n")) return SDLK_n;
+	if( !strcmp (name, "o")) return SDLK_o;
+	if( !strcmp (name, "p")) return SDLK_p;
+	if( !strcmp (name, "q")) return SDLK_q;
+	if( !strcmp (name, "r")) return SDLK_r;
+	if( !strcmp (name, "s")) return SDLK_s;
+	if( !strcmp (name, "t")) return SDLK_t;
+	if( !strcmp (name, "u")) return SDLK_u;
+	if( !strcmp (name, "v")) return SDLK_v;
+	if( !strcmp (name, "w")) return SDLK_w;
+	if( !strcmp (name, "x")) return SDLK_x;
+	if( !strcmp (name, "y")) return SDLK_y;
+	if( !strcmp (name, "z")) return SDLK_z;
+	if( !strcmp (name, "DELETE")) return SDLK_DELETE;
+	if( !strcmp (name, "KP0")) return SDLK_KP0;
+	if( !strcmp (name, "KP1")) return SDLK_KP1;
+	if( !strcmp (name, "KP2")) return SDLK_KP2;
+	if( !strcmp (name, "KP3")) return SDLK_KP3;
+	if( !strcmp (name, "KP4")) return SDLK_KP4;
+	if( !strcmp (name, "KP5")) return SDLK_KP5;
+	if( !strcmp (name, "KP6")) return SDLK_KP6;
+	if( !strcmp (name, "KP7")) return SDLK_KP7;
+	if( !strcmp (name, "KP8")) return SDLK_KP8;
+	if( !strcmp (name, "KP9")) return SDLK_KP9;
+	if( !strcmp (name, "KP_PERIOD")) return SDLK_KP_PERIOD;
+	if( !strcmp (name, "KP_DIVIDE")) return SDLK_KP_DIVIDE;
+	if( !strcmp (name, "KP_MULTIPLY")) return SDLK_KP_MULTIPLY;
+	if( !strcmp (name, "KP_MINUS")) return SDLK_KP_MINUS;
+	if( !strcmp (name, "KP_PLUS")) return SDLK_KP_PLUS;
+	if( !strcmp (name, "KP_ENTER")) return SDLK_KP_ENTER;
+	if( !strcmp (name, "KP_EQUALS")) return SDLK_KP_EQUALS;
+	if( !strcmp (name, "UP")) return SDLK_UP;
+	if( !strcmp (name, "DOWN")) return SDLK_DOWN;
+	if( !strcmp (name, "RIGHT")) return SDLK_RIGHT;
+	if( !strcmp (name, "LEFT")) return SDLK_LEFT;
+	if( !strcmp (name, "INSERT")) return SDLK_INSERT;
+	if( !strcmp (name, "HOME")) return SDLK_HOME;
+	if( !strcmp (name, "END")) return SDLK_END;
+	if( !strcmp (name, "PAGEUP")) return SDLK_PAGEUP;
+	if( !strcmp (name, "PAGEDOWN")) return SDLK_PAGEDOWN;
+	if( !strcmp (name, "F1")) return SDLK_F1;
+	if( !strcmp (name, "F2")) return SDLK_F2;
+	if( !strcmp (name, "F3")) return SDLK_F3;
+	if( !strcmp (name, "F4")) return SDLK_F4;
+	if( !strcmp (name, "F5")) return SDLK_F5;
+	if( !strcmp (name, "F6")) return SDLK_F6;
+	if( !strcmp (name, "F7")) return SDLK_F7;
+	if( !strcmp (name, "F8")) return SDLK_F8;
+	if( !strcmp (name, "F9")) return SDLK_F9;
+	if( !strcmp (name, "F10")) return SDLK_F10;
+	if( !strcmp (name, "F11")) return SDLK_F11;
+	if( !strcmp (name, "F12")) return SDLK_F12;
+	if( !strcmp (name, "F13")) return SDLK_F13;
+	if( !strcmp (name, "F14")) return SDLK_F14;
+	if( !strcmp (name, "F15")) return SDLK_F15;
+	if( !strcmp (name, "NUMLOCK")) return SDLK_NUMLOCK;
+	if( !strcmp (name, "CAPSLOCK")) return SDLK_CAPSLOCK;
+	if( !strcmp (name, "SCROLLOCK")) return SDLK_SCROLLOCK;
+	if( !strcmp (name, "RSHIFT")) return SDLK_RSHIFT;
+	if( !strcmp (name, "LSHIFT")) return SDLK_LSHIFT;
+	if( !strcmp (name, "RCTRL")) return SDLK_RCTRL;
+	if( !strcmp (name, "LCTRL")) return SDLK_LCTRL;
+	if( !strcmp (name, "RALT")) return SDLK_RALT;
+	if( !strcmp (name, "LALT")) return SDLK_LALT;
+	if( !strcmp (name, "RMETA")) return SDLK_RMETA;
+	if( !strcmp (name, "LMETA")) return SDLK_LMETA;
+	if( !strcmp (name, "LSUPER")) return SDLK_LSUPER;
+	if( !strcmp (name, "RSUPER")) return SDLK_RSUPER;
+	if( !strcmp (name, "MODE")) return SDLK_MODE;
+	if( !strcmp (name, "HELP")) return SDLK_HELP;
+	if( !strcmp (name, "PRINT")) return SDLK_PRINT;
+	if( !strcmp (name, "SYSREQ")) return SDLK_SYSREQ;
+	if( !strcmp (name, "BREAK")) return SDLK_BREAK;
+	if( !strcmp (name, "MENU")) return SDLK_MENU;
+	if( !strcmp (name, "POWER")) return SDLK_POWER;
+	if( !strcmp (name, "EURO")) return SDLK_EURO;
+	return -1;
+}
+
+char* SDLK_to_keyname( int key)
+{
+	if( key == SDLK_BACKSPACE) return "BACKSPACE";
+	if( key == SDLK_TAB) return "TAB";
+	if( key == SDLK_CLEAR) return "CLEAR";
+	if( key == SDLK_RETURN) return "RETURN";
+	if( key == SDLK_ESCAPE) return "ESCAPE";
+	if( key == SDLK_EXCLAIM) return "EXCLAIM";
+	if( key == SDLK_QUOTEDBL) return "QUOTEDBL";
+	if( key == SDLK_HASH) return "HASH";
+	if( key == SDLK_PAUSE) return "PAUSE";
+	if( key == SDLK_DOLLAR) return "DOLLAR";
+	if( key == SDLK_AMPERSAND) return "AMPERSAND";
+	if( key == SDLK_QUOTE) return "QUOTE";
+	if( key == SDLK_LEFTPAREN) return "LEFTPAREN";
+	if( key == SDLK_RIGHTPAREN) return "RIGHTPAREN";
+	if( key == SDLK_ASTERISK) return "ASTERISK";
+	if( key == SDLK_PLUS) return "PLUS";
+	if( key == SDLK_COMMA) return "COMMA";
+	if( key == SDLK_MINUS) return "MINUS";
+	if( key == SDLK_PERIOD) return "PERIOD";
+	if( key == SDLK_SLASH) return "SLASH";
+	if( key == SDLK_0) return "0";
+	if( key == SDLK_1) return "1";
+	if( key == SDLK_2) return "2";
+	if( key == SDLK_3) return "3";
+	if( key == SDLK_4) return "4";
+	if( key == SDLK_5) return "5";
+	if( key == SDLK_6) return "6";
+	if( key == SDLK_7) return "7";
+	if( key == SDLK_8) return "8";
+	if( key == SDLK_9) return "9";
+	if( key == SDLK_COLON) return "COLON";
+	if( key == SDLK_SEMICOLON) return "SEMICOLON";
+	if( key == SDLK_LESS) return "LESS";
+	if( key == SDLK_EQUALS) return "EQUALS";
+	if( key == SDLK_GREATER) return "GREATER";
+	if( key == SDLK_QUESTION) return "QUESTION";
+	if( key == SDLK_AT) return "AT";
+	if( key == SDLK_LEFTBRACKET) return "LEFTBRACKET";
+	if( key == SDLK_BACKSLASH) return "BACKSLASH";
+	if( key == SDLK_RIGHTBRACKET) return "RIGHTBRACKET";
+	if( key == SDLK_CARET) return "CARET";
+	if( key == SDLK_UNDERSCORE) return "UNDERSCORE";
+	if( key == SDLK_BACKQUOTE) return "BACKQUOTE";
+	if( key == SDLK_a) return "a";
+	if( key == SDLK_b) return "b";
+	if( key == SDLK_c) return "c";
+	if( key == SDLK_d) return "d";
+	if( key == SDLK_e) return "e";
+	if( key == SDLK_f) return "f";
+	if( key == SDLK_g) return "g";
+	if( key == SDLK_h) return "h";
+	if( key == SDLK_i) return "i";
+	if( key == SDLK_j) return "j";
+	if( key == SDLK_k) return "k";
+	if( key == SDLK_l) return "l";
+	if( key == SDLK_m) return "m";
+	if( key == SDLK_n) return "n";
+	if( key == SDLK_o) return "o";
+	if( key == SDLK_p) return "p";
+	if( key == SDLK_q) return "q";
+	if( key == SDLK_r) return "r";
+	if( key == SDLK_s) return "s";
+	if( key == SDLK_t) return "t";
+	if( key == SDLK_u) return "u";
+	if( key == SDLK_v) return "v";
+	if( key == SDLK_w) return "w";
+	if( key == SDLK_x) return "x";
+	if( key == SDLK_y) return "y";
+	if( key == SDLK_z) return "z";
+	if( key == SDLK_DELETE) return "DELETE";
+	if( key == SDLK_KP0) return "KP0";
+	if( key == SDLK_KP1) return "KP1";
+	if( key == SDLK_KP2) return "KP2";
+	if( key == SDLK_KP3) return "KP3";
+	if( key == SDLK_KP4) return "KP4";
+	if( key == SDLK_KP5) return "KP5";
+	if( key == SDLK_KP6) return "KP6";
+	if( key == SDLK_KP7) return "KP7";
+	if( key == SDLK_KP8) return "KP8";
+	if( key == SDLK_KP9) return "KP9";
+	if( key == SDLK_KP_PERIOD) return "KP_PERIOD";
+	if( key == SDLK_KP_DIVIDE) return "KP_DIVIDE";
+	if( key == SDLK_KP_MULTIPLY) return "KP_MULTIPLY";
+	if( key == SDLK_KP_MINUS) return "KP_MINUS";
+	if( key == SDLK_KP_PLUS) return "KP_PLUS";
+	if( key == SDLK_KP_ENTER) return "KP_ENTER";
+	if( key == SDLK_KP_EQUALS) return "KP_EQUALS";
+	if( key == SDLK_UP) return "UP";
+	if( key == SDLK_DOWN) return "DOWN";
+	if( key == SDLK_RIGHT) return "RIGHT";
+	if( key == SDLK_LEFT) return "LEFT";
+	if( key == SDLK_INSERT) return "INSERT";
+	if( key == SDLK_HOME) return "HOME";
+	if( key == SDLK_END) return "END";
+	if( key == SDLK_PAGEUP) return "PAGEUP";
+	if( key == SDLK_PAGEDOWN) return "PAGEDOWN";
+	if( key == SDLK_F1) return "F1";
+	if( key == SDLK_F2) return "F2";
+	if( key == SDLK_F3) return "F3";
+	if( key == SDLK_F4) return "F4";
+	if( key == SDLK_F5) return "F5";
+	if( key == SDLK_F6) return "F6";
+	if( key == SDLK_F7) return "F7";
+	if( key == SDLK_F8) return "F8";
+	if( key == SDLK_F9) return "F9";
+	if( key == SDLK_F10) return "F10";
+	if( key == SDLK_F11) return "F11";
+	if( key == SDLK_F12) return "F12";
+	if( key == SDLK_F13) return "F13";
+	if( key == SDLK_F14) return "F14";
+	if( key == SDLK_F15) return "F15";
+	if( key == SDLK_NUMLOCK) return "NUMLOCK";
+	if( key == SDLK_CAPSLOCK) return "CAPSLOCK";
+	if( key == SDLK_SCROLLOCK) return "SCROLLOCK";
+	if( key == SDLK_RSHIFT) return "RSHIFT";
+	if( key == SDLK_LSHIFT) return "LSHIFT";
+	if( key == SDLK_RCTRL) return "RCTRL";
+	if( key == SDLK_LCTRL) return "LCTRL";
+	if( key == SDLK_RALT) return "RALT";
+	if( key == SDLK_LALT) return "LALT";
+	if( key == SDLK_RMETA) return "RMETA";
+	if( key == SDLK_LMETA) return "LMETA";
+	if( key == SDLK_LSUPER) return "LSUPER";
+	if( key == SDLK_RSUPER) return "RSUPER";
+	if( key == SDLK_MODE) return "MODE";
+	if( key == SDLK_HELP) return "HELP";
+	if( key == SDLK_PRINT) return "PRINT";
+	if( key == SDLK_SYSREQ) return "SYSREQ";
+	if( key == SDLK_BREAK) return "BREAK";
+	if( key == SDLK_MENU) return "MENU";
+	if( key == SDLK_POWER) return "POWER";
+	if( key == SDLK_EURO) return "EURO";
+	return "UNKNOWN"
+}
Index: /orxonox/branches/chris/src/keynames.h
===================================================================
--- /orxonox/branches/chris/src/keynames.h	(revision 2066)
+++ /orxonox/branches/chris/src/keynames.h	(revision 2066)
@@ -0,0 +1,18 @@
+/*!
+    \file keynames.h
+    \brief Key/button naming functions
+    
+		Converts strings to SDLK/SDL_BUTTON values and vice versa
+*/
+
+#ifdef __WIN32__
+#include <windows.h>
+#endif
+
+#include <SDL/SDL.h>
+
+int buttonname_to_SDLB( char* name);
+char* SDLB_to_buttonname( int button);
+int keyname_to_SDLK( char* name);
+char* SDLK_to_keyname( int key);
+
Index: /orxonox/branches/chris/src/message_structures.h
===================================================================
--- /orxonox/branches/chris/src/message_structures.h	(revision 2066)
+++ /orxonox/branches/chris/src/message_structures.h	(revision 2066)
@@ -0,0 +1,16 @@
+
+#ifndef _MESSAGESTRUCTURES_H
+#define _MESSAGESTRUCTURES_H
+
+#define CMD_LENGHT 16
+
+	// structure that contains commands
+typedef struct
+{
+	char cmd[CMD_LENGHT];
+	bool bUp;
+	Uint16 x, y;
+	Sint16 xrel, yrel;
+} Command;
+
+#endif
Index: /orxonox/branches/chris/src/stdincl.h
===================================================================
--- /orxonox/branches/chris/src/stdincl.h	(revision 2065)
+++ /orxonox/branches/chris/src/stdincl.h	(revision 2066)
@@ -5,3 +5,13 @@
 #define null 0
 
+#ifdef __WIN32__
+#include <windows.h>
 #endif
+#include <SDL/SDL.h>
+
+#include "list.h"
+#include "message_structures.h"
+#include "orxonox.h"
+#include "world_entity.h"
+
+#endif
Index: /orxonox/branches/chris/src/world_entity.h
===================================================================
--- /orxonox/branches/chris/src/world_entity.h	(revision 2065)
+++ /orxonox/branches/chris/src/world_entity.h	(revision 2066)
@@ -3,5 +3,6 @@
 #define WORLD_ENTITY_H
 
-#include "data_tank.h"
+#include "stdincl.h"
+//#include "data_tank.h"
 
 class Vector;
@@ -34,4 +35,5 @@
   virtual void hit(WorldEntity* weapon, Vector loc);
   virtual void destroy();
+  virtual void command (Command* cmd);
 
   virtual void entityPreEnter();
