about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/engine/client/ec_gfx.c144
-rw-r--r--src/engine/client/ec_inp.c120
-rw-r--r--src/engine/client/ec_snd.c52
-rw-r--r--src/engine/e_keynames.c516
-rw-r--r--src/engine/e_keys.h253
-rw-r--r--src/game/client/components/binds.cpp14
-rw-r--r--src/game/client/components/console.cpp2
7 files changed, 1087 insertions, 14 deletions
diff --git a/src/engine/client/ec_gfx.c b/src/engine/client/ec_gfx.c
index 9a1e70bf..6a760be7 100644
--- a/src/engine/client/ec_gfx.c
+++ b/src/engine/client/ec_gfx.c
@@ -1,5 +1,13 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
-#include <GL/glfw.h>
+
+#ifdef CONFIG_NO_SDL
+	#include <GL/glfw.h>
+#else
+	#include <SDL/SDL.h>
+	#include <GL/gl.h>
+	#include <GL/glu.h>
+#endif
+
 #include <engine/external/pnglite/pnglite.h>
 
 #include <base/system.h>
@@ -77,6 +85,11 @@ static TEXTURE textures[MAX_TEXTURES];
 static int first_free_texture;
 static int memory_usage = 0;
 
+#ifdef CONFIG_NO_SDL
+#else
+	SDL_Surface *screen_surface;
+#endif
+
 
 #if 0
 typedef struct { unsigned char r, g, b, a; } PIXEL;
@@ -289,12 +302,14 @@ static void draw_quad()
 		flush();
 }
 
+#ifdef CONFIG_NO_SDL
 static void screen_resize(int width, int height)
 {
 	screen_width = width;
 	screen_height = height;
 	glViewport(0, 0, screen_width, screen_height);
 }
+#endif
 
 int gfx_init()
 {
@@ -303,7 +318,6 @@ int gfx_init()
 	screen_width = config.gfx_screen_width;
 	screen_height = config.gfx_screen_height;
 
-	glfwInit();
 
 	if(config.dbg_stress)
 	{
@@ -311,6 +325,10 @@ int gfx_init()
 		screen_height = 240;
 	}
 
+
+#ifdef CONFIG_NO_SDL
+	glfwInit();
+
 	/* set antialiasing	*/
 	if(config.gfx_fsaa_samples)
 		glfwOpenWindowHint(GLFW_FSAA_SAMPLES, config.gfx_fsaa_samples);
@@ -357,6 +375,62 @@ int gfx_init()
 	/* We don't want to see the window when we run the stress testing */
 	if(config.dbg_stress)
 		glfwIconifyWindow();
+#else
+	if(SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0)
+	{
+        dbg_msg("gfx", "Unable to init SDL: %s\n", SDL_GetError());
+        return -1;
+    }
+	
+    atexit(SDL_Quit);
+
+	{
+		const SDL_VideoInfo *info;
+		int flags = SDL_OPENGL;
+		
+		info = SDL_GetVideoInfo();
+
+		/* set flags */
+		flags  = SDL_OPENGL;
+		flags |= SDL_GL_DOUBLEBUFFER;
+		flags |= SDL_HWPALETTE;
+		flags |= SDL_RESIZABLE;
+
+		if(info->hw_available)
+			flags |= SDL_HWSURFACE;
+		else
+			flags |= SDL_SWSURFACE;
+
+		if(info->blit_hw)
+			flags |= SDL_HWACCEL;
+
+		if(config.gfx_fullscreen)
+			flags |= SDL_FULLSCREEN;
+
+		/* set gl attributes */
+		if(config.gfx_fsaa_samples)
+		{
+			SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
+			SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, config.gfx_fsaa_samples);
+		}
+
+		SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+
+		/* set caption */
+		SDL_WM_SetCaption("Teeworlds", "Teeworlds");
+		
+		/* create window */
+		screen_surface = SDL_SetVideoMode(screen_width, screen_height, 0, flags);
+		if(screen_surface == NULL)
+		{
+	        dbg_msg("gfx", "Unable to set video mode: %s\n", SDL_GetError());
+    	    return -1;
+		}
+	}
+	
+	SDL_ShowCursor(0);
+
+#endif
 	
 	/* Init vertices */
 	if (vertices)
@@ -447,12 +521,20 @@ void gfx_mask_op(int mask, int write)
 
 int gfx_window_active()
 {
+#ifdef CONFIG_NO_SDL
 	return glfwGetWindowParam(GLFW_ACTIVE) == GL_TRUE ? 1 : 0;
+#else
+	return 1; /* TODO: SDL*/
+#endif
 }
 
 int gfx_window_open()
 {
+#ifdef CONFIG_NO_SDL
 	return glfwGetWindowParam(GLFW_OPENED) == GL_TRUE ? 1 : 0;
+#else
+	return 1; /* TODO: SDL*/
+#endif
 }
 
 VIDEO_MODE fakemodes[] = {
@@ -490,12 +572,52 @@ int gfx_get_video_modes(VIDEO_MODE *list, int maxcount)
 		return count;
 	}
 	
+#ifdef CONFIG_NO_SDL
 	return glfwGetVideoModes((GLFWvidmode *)list, maxcount);
+#else
+	{
+		/* TODO: fix this code on osx or windows */
+		int num_modes = 0;
+		SDL_Rect **modes;
+			
+		modes = SDL_ListModes(NULL, SDL_OPENGL|SDL_GL_DOUBLEBUFFER|SDL_FULLSCREEN);
+		if(modes == NULL)
+		{
+			/* no modes */
+		}
+		else if(modes == (SDL_Rect**)-1)
+		{
+			/* all modes */
+		}
+		else
+		{
+			int i;
+			for(i = 0; modes[i]; ++i)
+			{
+				if(num_modes == maxcount)
+					break;
+				list[num_modes].width = modes[i]->w;
+				list[num_modes].height = modes[i]->h;
+				list[num_modes].red = 8;
+				list[num_modes].green = 8;
+				list[num_modes].blue = 8;
+				num_modes++;
+			}
+		}
+	}
+	
+
+	return 1; /* TODO: SDL*/
+#endif	
 }
 
 void gfx_set_vsync(int val)
 {
+#ifdef CONFIG_NO_SDL
 	glfwSwapInterval(val);
+#else
+	/* TODO: SDL*/
+#endif	
 }
 
 int gfx_unload_texture(int index)
@@ -697,8 +819,13 @@ void gfx_shutdown()
 {
 	if (vertices)
 		mem_free(vertices);
+#ifdef CONFIG_NO_SDL
 	glfwCloseWindow();
 	glfwTerminate();
+#else
+	/* TODO: SDL, is this correct? */
+	SDL_Quit();
+#endif	
 }
 
 void gfx_screenshot()
@@ -783,19 +910,26 @@ void gfx_swap()
 	{
 		static PERFORMACE_INFO pscope = {"glfwSwapBuffers", 0};
 		perf_start(&pscope);
+#ifdef CONFIG_NO_SDL
 		glfwSwapBuffers();
+#else
+		SDL_GL_SwapBuffers();
+#endif
 		perf_end();
 	}
 	
 	if(render_enable && config.gfx_finish)
 		glFinish();
 
+#ifdef CONFIG_NO_SDL
 	{
 		static PERFORMACE_INFO pscope = {"glfwPollEvents", 0};
 		perf_start(&pscope);
 		glfwPollEvents();
 		perf_end();
 	}
+#else
+#endif
 }
 
 void gfx_screenshot_direct(const char *filename)
@@ -1350,10 +1484,16 @@ void gfx_clip_disable()
 
 void gfx_minimize()
 {
+#ifdef CONFIG_NO_SDL
 	glfwIconifyWindow();
+#else
+#endif
 }
 
 void gfx_maximize()
 {
+#ifdef CONFIG_NO_SDL
 	glfwRestoreWindow();
+#else
+#endif
 }
diff --git a/src/engine/client/ec_inp.c b/src/engine/client/ec_inp.c
index 00468434..f033ee70 100644
--- a/src/engine/client/ec_inp.c
+++ b/src/engine/client/ec_inp.c
@@ -1,14 +1,25 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
 #include <string.h>
-#include <GL/glfw.h>
+#ifdef CONFIG_NO_SDL
+	#include <GL/glfw.h>
+#else
+	#include <SDL/SDL.h>
+#endif
 
 #include <base/system.h>
 #include <engine/e_client_interface.h>
 #include <engine/e_config.h>
 
-static int keyboard_state[2][1024]; /* TODO: fix this!! */
+#ifdef CONFIG_NO_SDL
+static int keyboard_state[2][1024] = {{0}}; /* TODO: fix this!! */
+#else
+static unsigned char keyboard_state[2][1024] = {{0}}; /* TODO: fix this!! */
+#endif
 static int keyboard_current = 0;
+
+#ifdef CONFIG_NO_SDL
 static int keyboard_first = 1;
+#endif
 
 
 static struct
@@ -20,14 +31,16 @@ static struct
 static unsigned char input_state[2][1024] = {{0}, {0}};
 
 static int input_current = 0;
+#ifdef CONFIG_NO_SDL
 static unsigned int last_release = 0;
+#endif
 static unsigned int release_delta = -1;
 
 void inp_mouse_relative(int *x, int *y)
 {
 	static int last_x = 0, last_y = 0;
 	static int last_sens = 100.0f;
-	int nx, ny;
+	int nx = 0, ny = 0;
 	float sens = config.inp_mousesens/100.0f;
 	
 	if(last_sens != config.inp_mousesens)
@@ -37,8 +50,9 @@ void inp_mouse_relative(int *x, int *y)
 		last_sens = config.inp_mousesens;
 	}
 	
-	
+#ifdef CONFIG_NO_SDL
 	glfwGetMousePos(&nx, &ny);
+
 	nx *= sens;
 	ny *= sens;
 	
@@ -46,6 +60,12 @@ void inp_mouse_relative(int *x, int *y)
 	*y = ny-last_y;
 	last_x = nx;
 	last_y = ny;
+#else
+	SDL_GetRelativeMouseState(&nx, &ny);
+
+	*x = nx*sens;
+	*y = ny*sens;
+#endif
 }
 
 enum
@@ -88,6 +108,7 @@ INPUT_EVENT inp_get_event(int index)
 	return input_events[index];
 }
 
+#ifdef CONFIG_NO_SDL
 static void char_callback(int character, int action)
 {
 	if(action == GLFW_PRESS && character < 256)
@@ -177,6 +198,25 @@ void inp_mouse_mode_relative()
 	/*if (!config.gfx_debug_resizable)*/
 	glfwDisable(GLFW_MOUSE_CURSOR);
 }
+#else
+
+void inp_init()
+{
+	SDL_EnableUNICODE(1);
+}
+
+void inp_mouse_mode_absolute()
+{
+	SDL_ShowCursor(1);
+	SDL_WM_GrabInput(SDL_GRAB_OFF);
+}
+
+void inp_mouse_mode_relative()
+{
+	SDL_ShowCursor(0);
+	SDL_WM_GrabInput(SDL_GRAB_ON);
+}
+#endif
 
 int inp_mouse_doubleclick()
 {
@@ -211,8 +251,9 @@ int inp_button_pressed(int button) { return keyboard_state[keyboard_current][but
 
 void inp_update()
 {
+#ifdef CONFIG_NO_SDL
     int i, v;
-    
+
 	/* clear and begin count on the other one */
 	mem_zero(&input_count[input_current], sizeof(input_count[input_current]));
 	mem_copy(input_state[input_current], input_state[input_current^1], sizeof(input_state[input_current]));
@@ -234,6 +275,75 @@ void inp_update()
 			v = glfwGetKey(i) == GLFW_PRESS ? 1 : 0;
         keyboard_state[keyboard_current][i] = v;
     }
+#else
+	int i;
+	
+	/* clear and begin count on the other one */
+	mem_zero(&input_count[input_current], sizeof(input_count[input_current]));
+	mem_copy(input_state[input_current], input_state[input_current^1], sizeof(input_state[input_current]));
+	input_current^=1;
+	
+	{
+		Uint8 *state = SDL_GetKeyState(&i);
+		if(i >= KEY_LAST)
+			i = KEY_LAST-1;
+		mem_copy(keyboard_state[keyboard_current], state, i);
+	}
+	
+	keyboard_state[keyboard_current][KEY_MOUSE_1] = 0;
+	keyboard_state[keyboard_current][KEY_MOUSE_2] = 0;
+	keyboard_state[keyboard_current][KEY_MOUSE_3] = 0;
+	i = SDL_GetMouseState(NULL, NULL);
+	if(i&SDL_BUTTON(1)) keyboard_state[keyboard_current][KEY_MOUSE_1] = 1;
+	if(i&SDL_BUTTON(2)) keyboard_state[keyboard_current][KEY_MOUSE_2] = 1;
+	if(i&SDL_BUTTON(3)) keyboard_state[keyboard_current][KEY_MOUSE_3] = 1;
+	
+	{
+		SDL_Event event;
+	
+		while(SDL_PollEvent(&event))
+		{
+			int key = -1;
+			int action = INPFLAG_PRESS;
+			switch (event.type)
+			{
+				/* handle keys */
+				case SDL_KEYDOWN:
+					if(event.key.keysym.unicode < 255)
+						add_event(event.key.keysym.unicode, 0, 0);
+					key = event.key.keysym.sym;
+					break;
+				case SDL_KEYUP:
+					action = INPFLAG_RELEASE;
+					key = event.key.keysym.sym;
+					break;
+				
+				/* handle mouse buttons */
+				case SDL_MOUSEBUTTONUP:
+					action = INPFLAG_RELEASE;
+				case SDL_MOUSEBUTTONDOWN:
+					key = KEY_MOUSE_1+event.button.button-1;
+					break;
+					
+				/* other messages */
+				case SDL_QUIT:
+					exit(0);
+			}
+			
+			/* */
+			if(key != -1)
+			{
+				input_count[input_current^1][key].presses++;
+				input_state[input_current^1][key] = 1;
+				add_event(0, key, action);
+			}
+
+		}
+	}
+#endif
+
+	if(inp_key_pressed('q'))
+		exit(1);
 
 	/* handle mouse wheel */
 	/*
diff --git a/src/engine/client/ec_snd.c b/src/engine/client/ec_snd.c
index 9dcbafaa..c3563863 100644
--- a/src/engine/client/ec_snd.c
+++ b/src/engine/client/ec_snd.c
@@ -3,8 +3,14 @@
 #include <engine/e_client_interface.h>
 #include <engine/e_config.h>
 
+#ifdef CONFIG_NO_SDL
+	#include <portaudio.h>
+#else
+	#include <SDL/SDL.h>
+#endif
+
+
 #include <engine/external/wavpack/wavpack.h>
-#include <portaudio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
@@ -232,16 +238,24 @@ static void mix(short *final_out, unsigned frames)
 	}
 }
 
+#ifdef CONFIG_NO_SDL
+static PaStream *stream;
 static int pacallback(const void *in, void *out, unsigned long frames, const PaStreamCallbackTimeInfo* time, PaStreamCallbackFlags status, void *user)
 {
 	mix(out, frames);
 	return 0;
 }
+#else
+static void sdlcallback(void *unused, Uint8 *stream, int len)
+{
+	mix((short *)stream, len/2/2);
+}
+#endif
 
-static PaStream *stream;
 
 int snd_init()
 {
+#ifdef CONFIG_NO_SDL
 	PaStreamParameters params;
 	PaError err = Pa_Initialize();
 	
@@ -293,7 +307,36 @@ int snd_init()
 			pacallback,             /* specify our custom callback */
 			0x0); /* pass our data through to callback */
 	err = Pa_StartStream(stream);
+#else
+    SDL_AudioSpec format;
+	
+	sound_lock = lock_create();
+	
+	if(!config.snd_enable)
+		return 0;
+	
+	mixing_rate = config.snd_rate;
+
+    /* Set 16-bit stereo audio at 22Khz */
+    format.freq = config.snd_rate;
+    format.format = AUDIO_S16;
+    format.channels = 2;
+    format.samples = 512;        /* A good value for games */
+    format.callback = sdlcallback;
+    format.userdata = NULL;
+
+    /* Open the audio device and start playing sound! */
+    if(SDL_OpenAudio(&format, NULL) < 0)
+	{
+        dbg_msg("client/sound", "unable to open audio: %s", SDL_GetError());
+		return -1;
+    }
+	else
+        dbg_msg("client/sound", "sound init successful");
 
+	SDL_PauseAudio(0);
+	
+#endif
 	sound_enabled = 1;
 	snd_update(); /* update the volume */
 	return 0;
@@ -319,9 +362,12 @@ int snd_update()
 
 int snd_shutdown()
 {
+#ifdef CONFIG_NO_SDL	
 	Pa_StopStream(stream);
 	Pa_Terminate();
-
+#else
+	SDL_CloseAudio();
+#endif
 	lock_destroy(sound_lock);
 
 	return 0;
diff --git a/src/engine/e_keynames.c b/src/engine/e_keynames.c
index 64ac7642..500a28ad 100644
--- a/src/engine/e_keynames.c
+++ b/src/engine/e_keynames.c
@@ -4,6 +4,7 @@
 
 static const char key_strings[512][16] =
 {
+#ifdef CONFIG_NO_SDL
 	"&0",
 	"&1",
 	"&2",
@@ -516,6 +517,521 @@ static const char key_strings[512][16] =
 	"&509",
 	"&510",
 	"&511",
+#else
+
+	"first",
+	"&1",
+	"&2",
+	"&3",
+	"&4",
+	"&5",
+	"&6",
+	"&7",
+	"backspace",
+	"tab",
+	"&10",
+	"&11",
+	"clear",
+	"return",
+	"&14",
+	"&15",
+	"&16",
+	"&17",
+	"&18",
+	"pause",
+	"&20",
+	"&21",
+	"&22",
+	"&23",
+	"&24",
+	"&25",
+	"&26",
+	"escape",
+	"&28",
+	"&29",
+	"&30",
+	"&31",
+	"space",
+	"exclaim",
+	"quotedbl",
+	"hash",
+	"dollar",
+	"&37",
+	"ampersand",
+	"quote",
+	"leftparen",
+	"rightparen",
+	"asterisk",
+	"plus",
+	"comma",
+	"minus",
+	"period",
+	"slash",
+	"0",
+	"1",
+	"2",
+	"3",
+	"4",
+	"5",
+	"6",
+	"7",
+	"8",
+	"9",
+	"colon",
+	"semicolon",
+	"less",
+	"equals",
+	"greater",
+	"question",
+	"at",
+	"&65",
+	"&66",
+	"&67",
+	"&68",
+	"&69",
+	"&70",
+	"&71",
+	"&72",
+	"&73",
+	"&74",
+	"&75",
+	"&76",
+	"&77",
+	"&78",
+	"&79",
+	"&80",
+	"&81",
+	"&82",
+	"&83",
+	"&84",
+	"&85",
+	"&86",
+	"&87",
+	"&88",
+	"&89",
+	"&90",
+	"leftbracket",
+	"backslash",
+	"rightbracket",
+	"caret",
+	"underscore",
+	"backquote",
+	"a",
+	"b",
+	"c",
+	"d",
+	"e",
+	"f",
+	"g",
+	"h",
+	"i",
+	"j",
+	"k",
+	"l",
+	"m",
+	"n",
+	"o",
+	"p",
+	"q",
+	"r",
+	"s",
+	"t",
+	"u",
+	"v",
+	"w",
+	"x",
+	"y",
+	"z",
+	"&123",
+	"&124",
+	"&125",
+	"&126",
+	"delete",
+	"&128",
+	"&129",
+	"&130",
+	"&131",
+	"&132",
+	"&133",
+	"&134",
+	"&135",
+	"&136",
+	"&137",
+	"&138",
+	"&139",
+	"&140",
+	"&141",
+	"&142",
+	"&143",
+	"&144",
+	"&145",
+	"&146",
+	"&147",
+	"&148",
+	"&149",
+	"&150",
+	"&151",
+	"&152",
+	"&153",
+	"&154",
+	"&155",
+	"&156",
+	"&157",
+	"&158",
+	"&159",
+	"world_0",
+	"world_1",
+	"world_2",
+	"world_3",
+	"world_4",
+	"world_5",
+	"world_6",
+	"world_7",
+	"world_8",
+	"world_9",
+	"world_10",
+	"world_11",
+	"world_12",
+	"world_13",
+	"world_14",
+	"world_15",
+	"world_16",
+	"world_17",
+	"world_18",
+	"world_19",
+	"world_20",
+	"world_21",
+	"world_22",
+	"world_23",
+	"world_24",
+	"world_25",
+	"world_26",
+	"world_27",
+	"world_28",
+	"world_29",
+	"world_30",
+	"world_31",
+	"world_32",
+	"world_33",
+	"world_34",
+	"world_35",
+	"world_36",
+	"world_37",
+	"world_38",
+	"world_39",
+	"world_40",
+	"world_41",
+	"world_42",
+	"world_43",
+	"world_44",
+	"world_45",
+	"world_46",
+	"world_47",
+	"world_48",
+	"world_49",
+	"world_50",
+	"world_51",
+	"world_52",
+	"world_53",
+	"world_54",
+	"world_55",
+	"world_56",
+	"world_57",
+	"world_58",
+	"world_59",
+	"world_60",
+	"world_61",
+	"world_62",
+	"world_63",
+	"world_64",
+	"world_65",
+	"world_66",
+	"world_67",
+	"world_68",
+	"world_69",
+	"world_70",
+	"world_71",
+	"world_72",
+	"world_73",
+	"world_74",
+	"world_75",
+	"world_76",
+	"world_77",
+	"world_78",
+	"world_79",
+	"world_80",
+	"world_81",
+	"world_82",
+	"world_83",
+	"world_84",
+	"world_85",
+	"world_86",
+	"world_87",
+	"world_88",
+	"world_89",
+	"world_90",
+	"world_91",
+	"world_92",
+	"world_93",
+	"world_94",
+	"world_95",
+	"kp0",
+	"kp1",
+	"kp2",
+	"kp3",
+	"kp4",
+	"kp5",
+	"kp6",
+	"kp7",
+	"kp8",
+	"kp9",
+	"kp_period",
+	"kp_divide",
+	"kp_multiply",
+	"kp_minus",
+	"kp_plus",
+	"kp_enter",
+	"kp_equals",
+	"up",
+	"down",
+	"right",
+	"left",
+	"insert",
+	"home",
+	"end",
+	"pageup",
+	"pagedown",
+	"f1",
+	"f2",
+	"f3",
+	"f4",
+	"f5",
+	"f6",
+	"f7",
+	"f8",
+	"f9",
+	"f10",
+	"f11",
+	"f12",
+	"f13",
+	"f14",
+	"f15",
+	"&297",
+	"&298",
+	"&299",
+	"numlock",
+	"capslock",
+	"scrollock",
+	"rshift",
+	"lshift",
+	"rctrl",
+	"lctrl",
+	"ralt",
+	"lalt",
+	"rmeta",
+	"lmeta",
+	"lsuper",
+	"rsuper",
+	"mode",
+	"compose",
+	"help",
+	"print",
+	"sysreq",
+	"break",
+	"menu",
+	"power",
+	"euro",
+	"undo",
+	"mouse1",
+	"mouse2",
+	"mouse3",
+	"mouse4",
+	"mouse5",
+	"mouse6",
+	"mouse7",
+	"mouse8",
+	"mousewheelup",
+	"mousewheeldown",
+	"&333",
+	"&334",
+	"&335",
+	"&336",
+	"&337",
+	"&338",
+	"&339",
+	"&340",
+	"&341",
+	"&342",
+	"&343",
+	"&344",
+	"&345",
+	"&346",
+	"&347",
+	"&348",
+	"&349",
+	"&350",
+	"&351",
+	"&352",
+	"&353",
+	"&354",
+	"&355",
+	"&356",
+	"&357",
+	"&358",
+	"&359",
+	"&360",
+	"&361",
+	"&362",
+	"&363",
+	"&364",
+	"&365",
+	"&366",
+	"&367",
+	"&368",
+	"&369",
+	"&370",
+	"&371",
+	"&372",
+	"&373",
+	"&374",
+	"&375",
+	"&376",
+	"&377",
+	"&378",
+	"&379",
+	"&380",
+	"&381",
+	"&382",
+	"&383",
+	"&384",
+	"&385",
+	"&386",
+	"&387",
+	"&388",
+	"&389",
+	"&390",
+	"&391",
+	"&392",
+	"&393",
+	"&394",
+	"&395",
+	"&396",
+	"&397",
+	"&398",
+	"&399",
+	"&400",
+	"&401",
+	"&402",
+	"&403",
+	"&404",
+	"&405",
+	"&406",
+	"&407",
+	"&408",
+	"&409",
+	"&410",
+	"&411",
+	"&412",
+	"&413",
+	"&414",
+	"&415",
+	"&416",
+	"&417",
+	"&418",
+	"&419",
+	"&420",
+	"&421",
+	"&422",
+	"&423",
+	"&424",
+	"&425",
+	"&426",
+	"&427",
+	"&428",
+	"&429",
+	"&430",
+	"&431",
+	"&432",
+	"&433",
+	"&434",
+	"&435",
+	"&436",
+	"&437",
+	"&438",
+	"&439",
+	"&440",
+	"&441",
+	"&442",
+	"&443",
+	"&444",
+	"&445",
+	"&446",
+	"&447",
+	"&448",
+	"&449",
+	"&450",
+	"&451",
+	"&452",
+	"&453",
+	"&454",
+	"&455",
+	"&456",
+	"&457",
+	"&458",
+	"&459",
+	"&460",
+	"&461",
+	"&462",
+	"&463",
+	"&464",
+	"&465",
+	"&466",
+	"&467",
+	"&468",
+	"&469",
+	"&470",
+	"&471",
+	"&472",
+	"&473",
+	"&474",
+	"&475",
+	"&476",
+	"&477",
+	"&478",
+	"&479",
+	"&480",
+	"&481",
+	"&482",
+	"&483",
+	"&484",
+	"&485",
+	"&486",
+	"&487",
+	"&488",
+	"&489",
+	"&490",
+	"&491",
+	"&492",
+	"&493",
+	"&494",
+	"&495",
+	"&496",
+	"&497",
+	"&498",
+	"&499",
+	"&500",
+	"&501",
+	"&502",
+	"&503",
+	"&504",
+	"&505",
+	"&506",
+	"&507",
+	"&508",
+	"&509",
+	"&510",
+	"&511",
+#endif
 };
 
 const char *inp_key_name(int k) { if (k >= 0 && k < 512) return key_strings[k]; else return key_strings[0]; }
diff --git a/src/engine/e_keys.h b/src/engine/e_keys.h
index 9670f1a0..bb51ead6 100644
--- a/src/engine/e_keys.h
+++ b/src/engine/e_keys.h
@@ -1,9 +1,9 @@
 #ifndef ENGINE_KEYS_H
 #define ENGINE_KEYS_H
 /* AUTO GENERATED! DO NOT EDIT MANUALLY! */
-
 enum
 {
+#ifdef CONFIG_NO_SDL
 	KEY_UNKNOWN = -1,
 	KEY_SPACE = 32,
 	KEY_SPECIAL = 256,
@@ -82,6 +82,257 @@ enum
 	KEY_MOUSE_7 = KEY_MOUSE_FIRST+6,
 	KEY_MOUSE_8 = KEY_MOUSE_FIRST+7,
 	KEY_LAST
+#else
+	KEY_UNKNOWN = 0,
+	KEY_FIRST = 0,
+	KEY_BACKSPACE = 8,
+	KEY_TAB = 9,
+	KEY_CLEAR = 12,
+	KEY_RETURN = 13,
+	KEY_PAUSE = 19,
+	KEY_ESCAPE = 27,
+	KEY_SPACE = 32,
+	KEY_EXCLAIM = 33,
+	KEY_QUOTEDBL = 34,
+	KEY_HASH = 35,
+	KEY_DOLLAR = 36,
+	KEY_AMPERSAND = 38,
+	KEY_QUOTE = 39,
+	KEY_LEFTPAREN = 40,
+	KEY_RIGHTPAREN = 41,
+	KEY_ASTERISK = 42,
+	KEY_PLUS = 43,
+	KEY_COMMA = 44,
+	KEY_MINUS = 45,
+	KEY_PERIOD = 46,
+	KEY_SLASH = 47,
+	KEY_0 = 48,
+	KEY_1 = 49,
+	KEY_2 = 50,
+	KEY_3 = 51,
+	KEY_4 = 52,
+	KEY_5 = 53,
+	KEY_6 = 54,
+	KEY_7 = 55,
+	KEY_8 = 56,
+	KEY_9 = 57,
+	KEY_COLON = 58,
+	KEY_SEMICOLON = 59,
+	KEY_LESS = 60,
+	KEY_EQUALS = 61,
+	KEY_GREATER = 62,
+	KEY_QUESTION = 63,
+	KEY_AT = 64,
+	KEY_LEFTBRACKET = 91,
+	KEY_BACKSLASH = 92,
+	KEY_RIGHTBRACKET = 93,
+	KEY_CARET = 94,
+	KEY_UNDERSCORE = 95,
+	KEY_BACKQUOTE = 96,
+	KEY_a = 97,
+	KEY_b = 98,
+	KEY_c = 99,
+	KEY_d = 100,
+	KEY_e = 101,
+	KEY_f = 102,
+	KEY_g = 103,
+	KEY_h = 104,
+	KEY_i = 105,
+	KEY_j = 106,
+	KEY_k = 107,
+	KEY_l = 108,
+	KEY_m = 109,
+	KEY_n = 110,
+	KEY_o = 111,
+	KEY_p = 112,
+	KEY_q = 113,
+	KEY_r = 114,
+	KEY_s = 115,
+	KEY_t = 116,
+	KEY_u = 117,
+	KEY_v = 118,
+	KEY_w = 119,
+	KEY_x = 120,
+	KEY_y = 121,
+	KEY_z = 122,
+	KEY_DELETE = 127,
+	KEY_WORLD_0 = 160,
+	KEY_WORLD_1 = 161,
+	KEY_WORLD_2 = 162,
+	KEY_WORLD_3 = 163,
+	KEY_WORLD_4 = 164,
+	KEY_WORLD_5 = 165,
+	KEY_WORLD_6 = 166,
+	KEY_WORLD_7 = 167,
+	KEY_WORLD_8 = 168,
+	KEY_WORLD_9 = 169,
+	KEY_WORLD_10 = 170,
+	KEY_WORLD_11 = 171,
+	KEY_WORLD_12 = 172,
+	KEY_WORLD_13 = 173,
+	KEY_WORLD_14 = 174,
+	KEY_WORLD_15 = 175,
+	KEY_WORLD_16 = 176,
+	KEY_WORLD_17 = 177,
+	KEY_WORLD_18 = 178,
+	KEY_WORLD_19 = 179,
+	KEY_WORLD_20 = 180,
+	KEY_WORLD_21 = 181,
+	KEY_WORLD_22 = 182,
+	KEY_WORLD_23 = 183,
+	KEY_WORLD_24 = 184,
+	KEY_WORLD_25 = 185,
+	KEY_WORLD_26 = 186,
+	KEY_WORLD_27 = 187,
+	KEY_WORLD_28 = 188,
+	KEY_WORLD_29 = 189,
+	KEY_WORLD_30 = 190,
+	KEY_WORLD_31 = 191,
+	KEY_WORLD_32 = 192,
+	KEY_WORLD_33 = 193,
+	KEY_WORLD_34 = 194,
+	KEY_WORLD_35 = 195,
+	KEY_WORLD_36 = 196,
+	KEY_WORLD_37 = 197,
+	KEY_WORLD_38 = 198,
+	KEY_WORLD_39 = 199,
+	KEY_WORLD_40 = 200,
+	KEY_WORLD_41 = 201,
+	KEY_WORLD_42 = 202,
+	KEY_WORLD_43 = 203,
+	KEY_WORLD_44 = 204,
+	KEY_WORLD_45 = 205,
+	KEY_WORLD_46 = 206,
+	KEY_WORLD_47 = 207,
+	KEY_WORLD_48 = 208,
+	KEY_WORLD_49 = 209,
+	KEY_WORLD_50 = 210,
+	KEY_WORLD_51 = 211,
+	KEY_WORLD_52 = 212,
+	KEY_WORLD_53 = 213,
+	KEY_WORLD_54 = 214,
+	KEY_WORLD_55 = 215,
+	KEY_WORLD_56 = 216,
+	KEY_WORLD_57 = 217,
+	KEY_WORLD_58 = 218,
+	KEY_WORLD_59 = 219,
+	KEY_WORLD_60 = 220,
+	KEY_WORLD_61 = 221,
+	KEY_WORLD_62 = 222,
+	KEY_WORLD_63 = 223,
+	KEY_WORLD_64 = 224,
+	KEY_WORLD_65 = 225,
+	KEY_WORLD_66 = 226,
+	KEY_WORLD_67 = 227,
+	KEY_WORLD_68 = 228,
+	KEY_WORLD_69 = 229,
+	KEY_WORLD_70 = 230,
+	KEY_WORLD_71 = 231,
+	KEY_WORLD_72 = 232,
+	KEY_WORLD_73 = 233,
+	KEY_WORLD_74 = 234,
+	KEY_WORLD_75 = 235,
+	KEY_WORLD_76 = 236,
+	KEY_WORLD_77 = 237,
+	KEY_WORLD_78 = 238,
+	KEY_WORLD_79 = 239,
+	KEY_WORLD_80 = 240,
+	KEY_WORLD_81 = 241,
+	KEY_WORLD_82 = 242,
+	KEY_WORLD_83 = 243,
+	KEY_WORLD_84 = 244,
+	KEY_WORLD_85 = 245,
+	KEY_WORLD_86 = 246,
+	KEY_WORLD_87 = 247,
+	KEY_WORLD_88 = 248,
+	KEY_WORLD_89 = 249,
+	KEY_WORLD_90 = 250,
+	KEY_WORLD_91 = 251,
+	KEY_WORLD_92 = 252,
+	KEY_WORLD_93 = 253,
+	KEY_WORLD_94 = 254,
+	KEY_WORLD_95 = 255,
+	KEY_KP0 = 256,
+	KEY_KP1 = 257,
+	KEY_KP2 = 258,
+	KEY_KP3 = 259,
+	KEY_KP4 = 260,
+	KEY_KP5 = 261,
+	KEY_KP6 = 262,
+	KEY_KP7 = 263,
+	KEY_KP8 = 264,
+	KEY_KP9 = 265,
+	KEY_KP_PERIOD = 266,
+	KEY_KP_DIVIDE = 267,
+	KEY_KP_MULTIPLY = 268,
+	KEY_KP_MINUS = 269,
+	KEY_KP_PLUS = 270,
+	KEY_KP_ENTER = 271,
+	KEY_KP_EQUALS = 272,
+	KEY_UP = 273,
+	KEY_DOWN = 274,
+	KEY_RIGHT = 275,
+	KEY_LEFT = 276,
+	KEY_INSERT = 277,
+	KEY_HOME = 278,
+	KEY_END = 279,
+	KEY_PAGEUP = 280,
+	KEY_PAGEDOWN = 281,
+	KEY_F1 = 282,
+	KEY_F2 = 283,
+	KEY_F3 = 284,
+	KEY_F4 = 285,
+	KEY_F5 = 286,
+	KEY_F6 = 287,
+	KEY_F7 = 288,
+	KEY_F8 = 289,
+	KEY_F9 = 290,
+	KEY_F10 = 291,
+	KEY_F11 = 292,
+	KEY_F12 = 293,
+	KEY_F13 = 294,
+	KEY_F14 = 295,
+	KEY_F15 = 296,
+	KEY_NUMLOCK = 300,
+	KEY_CAPSLOCK = 301,
+	KEY_SCROLLOCK = 302,
+	KEY_RSHIFT = 303,
+	KEY_LSHIFT = 304,
+	KEY_RCTRL = 305,
+	KEY_LCTRL = 306,
+	KEY_RALT = 307,
+	KEY_LALT = 308,
+	KEY_RMETA = 309,
+	KEY_LMETA = 310,
+	KEY_LSUPER = 311,
+	KEY_RSUPER = 312,
+	KEY_MODE = 313,
+	KEY_COMPOSE = 314,
+	KEY_HELP = 315,
+	KEY_PRINT = 316,
+	KEY_SYSREQ = 317,
+	KEY_BREAK = 318,
+	KEY_MENU = 319,
+	KEY_POWER = 320,
+	KEY_EURO = 321,
+	KEY_UNDO = 322,
+	KEY_MOUSE_1 = 323,
+	KEY_MOUSE_2 = 324,
+	KEY_MOUSE_3 = 325,
+	KEY_MOUSE_4 = 326,
+	KEY_MOUSE_5 = 327,
+	KEY_MOUSE_6 = 328,
+	KEY_MOUSE_7 = 329,
+	KEY_MOUSE_8 = 330,
+	KEY_MOUSE_WHEEL_UP = 331,
+	KEY_MOUSE_WHEEL_DOWN = 332,
+	KEY_LAST,
+	KEY_DEL=KEY_DELETE,
+	KEY_ENTER=KEY_RETURN,
+	KEY_KP_SUBTRACT=KEY_KP_MINUS,
+	KEY_KP_ADD=KEY_KP_PLUS,
+	KEY_ESC=KEY_ESCAPE
+#endif
 };
 
 #endif
diff --git a/src/game/client/components/binds.cpp b/src/game/client/components/binds.cpp
index b55e7333..de5f4f05 100644
--- a/src/game/client/components/binds.cpp
+++ b/src/game/client/components/binds.cpp
@@ -6,7 +6,7 @@
 bool BINDS::BINDS_SPECIAL::on_input(INPUT_EVENT e)
 {
 	// don't handle invalid events and keys that arn't set to anything
-	if(e.key >= KEY_F1 && e.key <= KEY_F25 && binds->keybindings[e.key][0] != 0)
+	if(e.key >= KEY_F1 && e.key <= KEY_F15 && binds->keybindings[e.key][0] != 0)
 	{
 		int stroke = 0;
 		if(e.flags&INPFLAG_PRESS)
@@ -86,9 +86,14 @@ void BINDS::set_defaults()
 	bind(KEY_F2, "toggle_remote_console");
 	bind(KEY_TAB, "+scoreboard");
 	bind(KEY_F10, "screenshot");
-	
+
+#ifdef CONFIG_NO_SDL
 	bind('A', "+left");
 	bind('D', "+right");
+#else
+	bind('a', "+left");
+	bind('d', "+right");
+#endif
 	bind(KEY_SPACE, "+jump");
 	bind(KEY_MOUSE_1, "+fire");
 	bind(KEY_MOUSE_2, "+hook");
@@ -103,8 +108,13 @@ void BINDS::set_defaults()
 	bind(KEY_MOUSE_WHEEL_UP, "+prevweapon");
 	bind(KEY_MOUSE_WHEEL_DOWN, "+nextweapon");
 	
+#ifdef CONFIG_NO_SDL
 	bind('T', "chat all");
 	bind('Y', "chat team");	
+#else
+	bind('t', "chat all");
+	bind('y', "chat team");	
+#endif
 
 	bind(KEY_F3, "vote yes");
 	bind(KEY_F4, "vote no");	
diff --git a/src/game/client/components/console.cpp b/src/game/client/components/console.cpp
index c8fe018e..71653fdf 100644
--- a/src/game/client/components/console.cpp
+++ b/src/game/client/components/console.cpp
@@ -295,7 +295,7 @@ bool CONSOLE::on_input(INPUT_EVENT e)
 {
 	if(console_state == CONSOLE_CLOSED)
 		return false;
-	if(e.key >= KEY_F1 && e.key <= KEY_F25)
+	if(e.key >= KEY_F1 && e.key <= KEY_F15)
 		return false;
 
 	if(e.key == KEY_ESC && (e.flags&INPFLAG_PRESS))