#pragma once
#include "Utils/MemoryUtils.h"

#include "Client.h"

namespace Hooks {
	class Keyboard {
	private:
		typedef void(__thiscall* Keyboard_)(int, bool);
		inline static Keyboard_ keyboard;

		static void callback(int, bool);
	public:
		inline static int state = -1;
		static void Init() {
			std::thread([&] {
				void* pattern = Utils::Memory::FindPattern(_("48 83 EC 48 0F B6 C1 4C"));

				state = Utils::Memory::CreateHook(pattern, (void*)&callback, &keyboard);

				if (state == 0)
					MessageBoxA(0, _("The program was terminated due to an error.\nError code: 1-2"), _("Valkyrie"), MB_ICONERROR);
				else
					std::cout << _("Test 1-2... OK\n");
				}).detach();
		}
	};
}
