package juvsi.survivalmod.client.helper;

import akka.io.Tcp.Message;
import juvsi.survivalmod.Survival;
import juvsi.survivalmod.client.gui.MessageDrawer;
import juvsi.survivalmod.client.proxy.ClientProxy;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.enchantment.EnchantmentFrostWalker;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class DebugKeyHandler
{
	@SideOnly(Side.CLIENT)
	@SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true)
	public void onEvent(KeyInputEvent event)
	{
		try 
		{
			KeyBinding[] keyBindings = ClientProxy.keyBindings;			
			
			if (keyBindings[0].isPressed()) //KEY K
			{
				System.out.println(keyBindings[0].getDisplayName() + " Pressed");
				ClientProxy.MESSAGER.AddMessage("Im am freezing");
				
			}
			if (keyBindings[1].isPressed())  //KEY L
			{
				System.out.println(keyBindings[1].getDisplayName() + " Pressed");
			

				ClientProxy.MESSAGER.AddMessage("Im not feeling well");
				ClientProxy.MESSAGER.AddMessage("I am bleeding");
				ClientProxy.MESSAGER.AddMessage("my Leg is broken");
				ClientProxy.MESSAGER.AddMessage("Im feeling hot");

			}
			
		} catch (Exception e) 
		{
			System.out.println(e.getMessage());
		}
	}
}