/******************************************************************************
*	File		-	key_codes.h
*	Author		-	Joey Pollack
*	Date		-	2019/11/14 (y/m/d)
*	Mod Date	-	2021/09/08 (y/m/d)
*	Description	-	Key code definitions using GLFW
*
******************************************************************************/

#ifndef KEY_CODES_H_
#define KEY_CODES_H_

#include "window.h"
#include <vector>

namespace lunarium
{
	enum KeyCode
	{
		A = 'A',
		B = 'B',
		C = 'C',
		D = 'D',
		E = 'E',
		F = 'F',
		G = 'G',
		H = 'H',
		I = 'I',
		J = 'J',
		K = 'K',
		L = 'L',
		M = 'M',
		N = 'N',
		O = 'O',
		P = 'P',
		Q = 'Q',
		R = 'R',
		S = 'S',
		T = 'T',
		U = 'U',
		V = 'V',
		W = 'W',
		X = 'X',
		Y = 'Y',
		Z = 'Z',

		NUM_0 = '0',
		NUM_1 = '1',
		NUM_2 = '2',
		NUM_3 = '3',
		NUM_4 = '4',
		NUM_5 = '5',
		NUM_6 = '6',
		NUM_7 = '7',
		NUM_8 = '8',
		NUM_9 = '9',

		F1 = GLFW_KEY_F1,
		F2 = GLFW_KEY_F2,
		F3 = GLFW_KEY_F3,
		F4 = GLFW_KEY_F4,
		F5 = GLFW_KEY_F5,
		F6 = GLFW_KEY_F6,
		F7 = GLFW_KEY_F7,
		F8 = GLFW_KEY_F8,
		F9 = GLFW_KEY_F9,
		F10 = GLFW_KEY_F10,
		F11 = GLFW_KEY_F11,
		F12 = GLFW_KEY_F12,

		LSHIFT = GLFW_KEY_LEFT_SHIFT,
		RSHIFT = GLFW_KEY_RIGHT_SHIFT,
		LCONTROL = GLFW_KEY_LEFT_CONTROL,
		RCONTROL = GLFW_KEY_RIGHT_CONTROL,
		LALT = GLFW_KEY_LEFT_ALT,
		RALT = GLFW_KEY_RIGHT_ALT,

		SPACE = GLFW_KEY_SPACE,

		// Left Arrow Key
		LEFT = GLFW_KEY_LEFT,

		// Up Arrow Key
		UP = GLFW_KEY_UP,

		// Right Arrow Key
		RIGHT = GLFW_KEY_RIGHT,

		// Down Arrow Key
		DOWN = GLFW_KEY_DOWN,

		// DELETE
		DEL = GLFW_KEY_DELETE,

		// ENTER
		RETURN  = GLFW_KEY_ENTER,

		BACKSPACE = GLFW_KEY_BACKSPACE,
		TAB  = GLFW_KEY_TAB,

		ESCAPE = GLFW_KEY_ESCAPE,

		PAGE_UP = GLFW_KEY_PAGE_UP,
		PAGE_DOWN = GLFW_KEY_PAGE_DOWN,

		// Punctuation
		SEMICOLON = GLFW_KEY_SEMICOLON,			// ';:' for US
		EQUALS = GLFW_KEY_EQUAL,				// '+' any country
		COMMA = GLFW_KEY_COMMA,					// ',' any country
		DASH = GLFW_KEY_MINUS,					// '-' any country
		DOT = GLFW_KEY_PERIOD,					// '.' any country
		FORWARD_SLASH = GLFW_KEY_SLASH,   		// '/?' for US
		TILDE = GLFW_KEY_GRAVE_ACCENT,			// '`~' for US

		OPEN_BRACKET = GLFW_KEY_LEFT_BRACKET,	//  '[{' for US
		BACKSLASH = GLFW_KEY_BACKSLASH,			//  '\|' for US
		CLOSE_BRACKET = GLFW_KEY_RIGHT_BRACKET,	//  ']}' for US
		QUOTE = GLFW_KEY_APOSTROPHE,			//  ''"' for US

		// MOUSE BUTTONS
		MOUSE_LEFT_BUTTON = GLFW_MOUSE_BUTTON_LEFT,
		MOUSE_RIGHT_BUTTON = GLFW_MOUSE_BUTTON_RIGHT,
		MOUSE_MIDDLE_BUTTON = GLFW_MOUSE_BUTTON_MIDDLE,

		// NOTE: Not sure about these
		MOUSE_X1_BUTTON = GLFW_MOUSE_BUTTON_4,
		MOUSE_X2_BUTTON = GLFW_MOUSE_BUTTON_5,

		// ALTERNATE NAMES
		SHIFT = GLFW_KEY_LEFT_SHIFT,
		CONTROL = GLFW_KEY_LEFT_CONTROL,
		ALT = GLFW_KEY_LEFT_ALT,

		KEY_UNKNOWN = 0xFFFF
	};

	static std::vector<int> KeyCodeList = {
		KeyCode::A,
		KeyCode::B,
		KeyCode::C,
		KeyCode::D,
		KeyCode::E,
		KeyCode::F,
		KeyCode::G,
		KeyCode::H,
		KeyCode::I,
		KeyCode::J,
		KeyCode::K,
		KeyCode::L,
		KeyCode::M,
		KeyCode::N,
		KeyCode::O,
		KeyCode::P,
		KeyCode::Q,
		KeyCode::R,
		KeyCode::S,
		KeyCode::T,
		KeyCode::U,
		KeyCode::V,
		KeyCode::W,
		KeyCode::X,
		KeyCode::Y,
		KeyCode::Z,

		KeyCode::NUM_0,
		KeyCode::NUM_1,
		KeyCode::NUM_2,
		KeyCode::NUM_3,
		KeyCode::NUM_4,
		KeyCode::NUM_5,
		KeyCode::NUM_6,
		KeyCode::NUM_7,
		KeyCode::NUM_8,
		KeyCode::NUM_9,

		KeyCode::F1,
		KeyCode::F2,
		KeyCode::F3,
		KeyCode::F4,
		KeyCode::F5,
		KeyCode::F6,
		KeyCode::F7,
		KeyCode::F8,
		KeyCode::F9,
		KeyCode::F10,
		KeyCode::F11,
		KeyCode::F12,

		KeyCode::LSHIFT,
		KeyCode::RSHIFT,
		KeyCode::LCONTROL,
		KeyCode::RCONTROL,
		KeyCode::LALT,
		KeyCode::RALT,
		KeyCode::SPACE,
		KeyCode::LEFT,
		KeyCode::UP,
		KeyCode::RIGHT,
		KeyCode::DOWN,
		KeyCode::DEL,
		KeyCode::RETURN,
		KeyCode::BACKSPACE,
		KeyCode::TAB,
		KeyCode::ESCAPE,
		KeyCode::PAGE_UP,
		KeyCode::PAGE_DOWN,
		KeyCode::SEMICOLON,		
		KeyCode::EQUALS,			
		KeyCode::COMMA,					
		KeyCode::DASH,					
		KeyCode::DOT,					
		KeyCode::FORWARD_SLASH,   		
		KeyCode::TILDE,			
		KeyCode::OPEN_BRACKET,	
		KeyCode::BACKSLASH,			
		KeyCode::CLOSE_BRACKET,	
		KeyCode::QUOTE,			
		KeyCode::MOUSE_LEFT_BUTTON,
		KeyCode::MOUSE_RIGHT_BUTTON,
		KeyCode::MOUSE_MIDDLE_BUTTON,
		KeyCode::MOUSE_X1_BUTTON,
		KeyCode::MOUSE_X2_BUTTON
	};
}


#endif	// KEY_CODES_H_