package speiger.src.coreengine.rendering.inputOld.bindings.utils;

import org.lwjgl.glfw.GLFW;

import speiger.src.coreengine.rendering.inputOld.Keyboard;
import speiger.src.coreengine.rendering.inputOld.Mouse;

public enum BindingType
{
	KEYBOARD {
		@Override
		public String getName(int key) {
			if(key >= GLFW.GLFW_KEY_F1 && key <= GLFW.GLFW_KEY_F25) return "F"+(key - GLFW.GLFW_KEY_F1+1);
			else if(key == GLFW.GLFW_KEY_DELETE) return "Delete";
			String s = GLFW.glfwGetKeyName(key, GLFW.glfwGetKeyScancode(key));
			return s == null ? "Unkonwn" : s.toUpperCase();
		}
		
		@Override
		public boolean isPressed(int key) { return Keyboard.isKeyFullyPressed(key); }
	},
	MOUSE {
		@Override
		public String getName(int key) { return "Button: "+key; }
		@Override
		public boolean isPressed(int key) { return Mouse.isButtonPressed(key); }
	},
	NONE {
		@Override
		public String getName(int key) { return "None"; }
		@Override
		public boolean isPressed(int key) { return false; }
	};
	public abstract String getName(int key);
	public abstract boolean isPressed(int key);
}
