#ifndef CONFIG_H
#define CONFIG_H

#include "keybind.h"

#define KEYBINDS_MAX_SIZE 1048
#define KMS KEYBINDS_MAX_SIZE
static struct keybinds keybinds[KMS] = {
	[SDLK_LEFT % KMS] = {
		.size = 1,
		.binds = {
			{KMOD_NONE, keybind_mv_cur_char, {.dir = DIR_BACKWARD}}
		}
	},
	[SDLK_RIGHT % KMS] = {
		.size = 1,
		.binds = {
			{KMOD_NONE, keybind_mv_cur_char, {.dir = DIR_FORWARD}}
		}
	},
	[SDLK_DELETE % KMS] = {
		.size = 1,
		.binds = {
			{KMOD_NONE, keybind_delete_char, {.dir = DIR_FORWARD}},
		}
	},
	[SDLK_UP % KMS] = {
		.size = 1,
		.binds = {
			{KMOD_NONE, keybind_mv_cur_line, {.dir = DIR_BACKWARD}}
		}
	},
	[SDLK_DOWN % KMS] = {
		.size = 1,
		.binds = {
			{KMOD_NONE, keybind_mv_cur_line, {.dir = DIR_FORWARD}}
		}
	},
	[SDLK_RETURN % KMS] = {
		.size = 1,
		.binds = {
			{KMOD_NONE, keybind_insert_newline, {.ptr = NULL}}
		}
	},
	[SDLK_BACKSPACE % KMS] = {
		.size = 2,
		.binds = {
			{KMOD_NONE, keybind_delete_char, {.dir = DIR_BACKWARD}},
			{KMOD_CTRL, keybind_delete_word, {.dir = DIR_BACKWARD}}
		}
	},
	[SDLK_f % KMS] = {
		.size = 2,
		.binds = {
			{KMOD_ALT, keybind_mv_cur_word, {.dir = DIR_FORWARD}},
			{KMOD_CTRL, keybind_toggle_fps, {.ptr = NULL}}
		}
	},
	[SDLK_b % KMS] = {
		.size = 1,
		.binds = {
			{KMOD_ALT, keybind_mv_cur_word, {.dir = DIR_BACKWARD}}
		}
	},
	[SDLK_d % KMS] = {
		.size = 1,
		.binds = {
			{KMOD_ALT, keybind_delete_word, {.dir = DIR_FORWARD}}
		}
	},
	[SDLK_a % KMS] = {
		.size = 1,
		.binds = {
			{KMOD_CTRL, keybind_mv_cur_beg_line, {.ptr = NULL}}
		}
	},
	[SDLK_e % KMS] = {
		.size = 1,
		.binds = {
			{KMOD_CTRL, keybind_mv_cur_end_line, {.ptr = NULL}}
		}
	},
	[SDLK_s % KMS] = {
		.size = 1,
		.binds = {
			{KMOD_CTRL, keybind_save_buffer, {.ptr = NULL}}
		}
	},
	[SDLK_PERIOD % KMS] = {
		.size = 1,
		.binds = {
			{KMOD_ALT | KMOD_SHIFT, keybind_mv_cur_end_buffer,
			 {.dir = DIR_FORWARD}}
		}
	},
	[SDLK_COMMA % KMS] = {
		.size = 1,
		.binds = {
			{KMOD_ALT | KMOD_SHIFT, keybind_mv_cur_end_buffer,
			 {.dir = DIR_BACKWARD}}
		}
	},
};


#undef KMS

#endif
