package ru.dbotthepony.kstarbound.client.input

import org.apache.logging.log4j.LogManager
import org.lwjgl.glfw.GLFW.*
import kotlin.reflect.KProperty

private interface IsHeldDown {
	operator fun getValue(thisRef: Any?, property: KProperty<*>?): Boolean
}

private interface HowLongHeldDown {
	operator fun getValue(thisRef: Any?, property: KProperty<*>?): Double
}

typealias ScrollCallback = (invalidate: () -> Unit, x: Double, y: Double) -> Unit

@Suppress("unused")
class UserInput : IUserInput {
	fun keyPressed(code: Int) {
		// println("Key press! $code")
	}

	fun keyReleased(code: Int, howLongHeldDown: Double) {
		// println("Key release! $code helt for $howLongHeldDown")
	}

	fun keyHeldDown(code: Int, delta: Double, howLongHeldDown: Double) {

	}

	private val userKeys = ArrayList<UserKey>()

	private inner class UserKey(val code: Int, val name: String, private val isKeyboard: Boolean = true) {
		init {
			userKeys.add(this)
		}

		private var pressed = false
		private var pressedRightAway = 0
		private var depressedRightAway = 0

		private var pressedSince = 0.0
		private var lastHeldDownCall = 0.0
		private var counter = 0.0

		val delegatePressed = object : IsHeldDown {
			override fun getValue(thisRef: Any?, property: KProperty<*>?): Boolean {
				return pressed
			}
		}

		val delegatePressedRightAway = object : IsHeldDown {
			override fun getValue(thisRef: Any?, property: KProperty<*>?): Boolean {
				return pressedRightAway > 0
			}
		}

		val delegateDepressedRightAway = object : IsHeldDown {
			override fun getValue(thisRef: Any?, property: KProperty<*>?): Boolean {
				return depressedRightAway > 0
			}
		}

		val delegateHowLong = object : HowLongHeldDown {
			override fun getValue(thisRef: Any?, property: KProperty<*>?): Double {
				if (!pressed)
					return 0.0

				return counter
			}
		}

		fun updateState(state: Int) {
			when (state) {
				GLFW_PRESS -> updateState(true)
				GLFW_RELEASE -> updateState(false)
				GLFW_REPEAT -> {
					//updateState(false)
					updateState(true)
					//println("Repeat! $name")
				}
			}
		}

		fun updateState(state: Boolean) {
			if (pressed == state)
				return

			if (state) {
				pressedRightAway = 2
				lastHeldDownCall = glfwGetTime()
				pressedSince = glfwGetTime()
				counter = 0.0
			} else {
				depressedRightAway = 2
			}

			if (isKeyboard) {
				if (pressed) {
					keyReleased(code, glfwGetTime() - pressedSince)
				} else {
					keyPressed(code)
				}
			}

			pressed = state
		}

		fun think(delta: Double, thisTime: Double) {
			pressedRightAway--
			depressedRightAway--

			if (pressed) {
				counter += delta

				if (isKeyboard) {
					keyHeldDown(code, delta, thisTime - pressedSince)
				}
			}
		}
	}

	fun callChange(key: Int, action: Int) {
		val mappedKey = keyMap[key]

		if (mappedKey == null) {
			LOGGER.warn("No key handling registered for $key!")
			return
		}

		mappedKey.updateState(action)
	}

	private var lastScrollUpdate = 0

	private val scrollCallbacks = ArrayList<ScrollCallback>()

	fun addScrollCallback(callback: ScrollCallback): Boolean {
		if (!scrollCallbacks.contains(callback)) {
			scrollCallbacks.add(callback)
			return true
		}

		return false
	}

	private var inScrollCallback = false

	fun removeScrollCallback(callback: ScrollCallback): Boolean {
		if (inScrollCallback) {
			throw ConcurrentModificationException("Can't remove scroll callback while iterating them, use invalidate function inside scroll callback itself!")
		}

		return scrollCallbacks.remove(callback)
	}

	var lastScrollX: Double = 0.0
		private set

	var lastScrollY: Double = 0.0
		private set

	fun callScroll(x: Double, y: Double) {
		lastScrollX = x
		lastScrollY = y
		lastScrollUpdate = frame

		val iterator = scrollCallbacks.iterator()
		var i = 0

		while (iterator.hasNext()) {
			i++
			val ithis = i
			val value = iterator.next()

			value.invoke({
				if (i != ithis) {
					throw IllegalStateException("What the hell did you just do")
				}

				iterator.remove()
			}, x, y)
		}
	}

	fun installCallback(window: Long) {
		glfwSetKeyCallback(window) { _, key, scancode, action, mods ->
			callChange(key, action)
		}

		glfwSetScrollCallback(window) { _, x, y ->
			callScroll(x, y)
		}
	}

	private var lastTick = 0.0

	var frame = 0
		private set

	fun think() {
		val scrollCooldown = lastScrollUpdate != frame
		frame++

		val thisTime = glfwGetTime()
		val delta = thisTime - lastTick
		lastTick = thisTime

		for (key in userKeys) {
			key.think(delta, thisTime)
		}

		if (scrollCooldown) {
			lastScrollX = 0.0
			lastScrollY = 0.0
		}
	}

	private val keyMap = mapOf(
		GLFW_KEY_SPACE to UserKey(GLFW_KEY_SPACE, "KEY_SPACE"),
		GLFW_KEY_APOSTROPHE to UserKey(GLFW_KEY_APOSTROPHE, "KEY_APOSTROPHE"),
		GLFW_KEY_COMMA to UserKey(GLFW_KEY_COMMA, "KEY_COMMA"),
		GLFW_KEY_MINUS to UserKey(GLFW_KEY_MINUS, "KEY_MINUS"),
		GLFW_KEY_PERIOD to UserKey(GLFW_KEY_PERIOD, "KEY_PERIOD"),
		GLFW_KEY_SLASH to UserKey(GLFW_KEY_SLASH, "KEY_SLASH"),
		GLFW_KEY_0 to UserKey(GLFW_KEY_0, "KEY_0"),
		GLFW_KEY_1 to UserKey(GLFW_KEY_1, "KEY_1"),
		GLFW_KEY_2 to UserKey(GLFW_KEY_2, "KEY_2"),
		GLFW_KEY_3 to UserKey(GLFW_KEY_3, "KEY_3"),
		GLFW_KEY_4 to UserKey(GLFW_KEY_4, "KEY_4"),
		GLFW_KEY_5 to UserKey(GLFW_KEY_5, "KEY_5"),
		GLFW_KEY_6 to UserKey(GLFW_KEY_6, "KEY_6"),
		GLFW_KEY_7 to UserKey(GLFW_KEY_7, "KEY_7"),
		GLFW_KEY_8 to UserKey(GLFW_KEY_8, "KEY_8"),
		GLFW_KEY_9 to UserKey(GLFW_KEY_9, "KEY_9"),
		GLFW_KEY_SEMICOLON to UserKey(GLFW_KEY_SEMICOLON, "KEY_SEMICOLON"),
		GLFW_KEY_EQUAL to UserKey(GLFW_KEY_EQUAL, "KEY_EQUAL"),
		GLFW_KEY_A to UserKey(GLFW_KEY_A, "KEY_A"),
		GLFW_KEY_B to UserKey(GLFW_KEY_B, "KEY_B"),
		GLFW_KEY_C to UserKey(GLFW_KEY_C, "KEY_C"),
		GLFW_KEY_D to UserKey(GLFW_KEY_D, "KEY_D"),
		GLFW_KEY_E to UserKey(GLFW_KEY_E, "KEY_E"),
		GLFW_KEY_F to UserKey(GLFW_KEY_F, "KEY_F"),
		GLFW_KEY_G to UserKey(GLFW_KEY_G, "KEY_G"),
		GLFW_KEY_H to UserKey(GLFW_KEY_H, "KEY_H"),
		GLFW_KEY_I to UserKey(GLFW_KEY_I, "KEY_I"),
		GLFW_KEY_J to UserKey(GLFW_KEY_J, "KEY_J"),
		GLFW_KEY_K to UserKey(GLFW_KEY_K, "KEY_K"),
		GLFW_KEY_L to UserKey(GLFW_KEY_L, "KEY_L"),
		GLFW_KEY_M to UserKey(GLFW_KEY_M, "KEY_M"),
		GLFW_KEY_N to UserKey(GLFW_KEY_N, "KEY_N"),
		GLFW_KEY_O to UserKey(GLFW_KEY_O, "KEY_O"),
		GLFW_KEY_P to UserKey(GLFW_KEY_P, "KEY_P"),
		GLFW_KEY_Q to UserKey(GLFW_KEY_Q, "KEY_Q"),
		GLFW_KEY_R to UserKey(GLFW_KEY_R, "KEY_R"),
		GLFW_KEY_S to UserKey(GLFW_KEY_S, "KEY_S"),
		GLFW_KEY_T to UserKey(GLFW_KEY_T, "KEY_T"),
		GLFW_KEY_U to UserKey(GLFW_KEY_U, "KEY_U"),
		GLFW_KEY_V to UserKey(GLFW_KEY_V, "KEY_V"),
		GLFW_KEY_W to UserKey(GLFW_KEY_W, "KEY_W"),
		GLFW_KEY_X to UserKey(GLFW_KEY_X, "KEY_X"),
		GLFW_KEY_Y to UserKey(GLFW_KEY_Y, "KEY_Y"),
		GLFW_KEY_Z to UserKey(GLFW_KEY_Z, "KEY_Z"),
		GLFW_KEY_LEFT_BRACKET to UserKey(GLFW_KEY_LEFT_BRACKET, "KEY_LEFT_BRACKET"),
		GLFW_KEY_BACKSLASH to UserKey(GLFW_KEY_BACKSLASH, "KEY_BACKSLASH"),
		GLFW_KEY_RIGHT_BRACKET to UserKey(GLFW_KEY_RIGHT_BRACKET, "KEY_RIGHT_BRACKET"),
		GLFW_KEY_GRAVE_ACCENT to UserKey(GLFW_KEY_GRAVE_ACCENT, "KEY_GRAVE_ACCENT"),
		GLFW_KEY_WORLD_1 to UserKey(GLFW_KEY_WORLD_1, "KEY_WORLD_1"),
		GLFW_KEY_WORLD_2 to UserKey(GLFW_KEY_WORLD_2, "KEY_WORLD_2"),

		GLFW_KEY_ESCAPE to UserKey(GLFW_KEY_ESCAPE, "KEY_ESCAPE"),
		GLFW_KEY_ENTER to UserKey(GLFW_KEY_ENTER, "KEY_ENTER"),
		GLFW_KEY_TAB to UserKey(GLFW_KEY_TAB, "KEY_TAB"),
		GLFW_KEY_BACKSPACE to UserKey(GLFW_KEY_BACKSPACE, "KEY_BACKSPACE"),
		GLFW_KEY_INSERT to UserKey(GLFW_KEY_INSERT, "KEY_INSERT"),
		GLFW_KEY_DELETE to UserKey(GLFW_KEY_DELETE, "KEY_DELETE"),
		GLFW_KEY_RIGHT to UserKey(GLFW_KEY_RIGHT, "KEY_RIGHT"),
		GLFW_KEY_LEFT to UserKey(GLFW_KEY_LEFT, "KEY_LEFT"),
		GLFW_KEY_DOWN to UserKey(GLFW_KEY_DOWN, "KEY_DOWN"),
		GLFW_KEY_UP to UserKey(GLFW_KEY_UP, "KEY_UP"),
		GLFW_KEY_PAGE_UP to UserKey(GLFW_KEY_PAGE_UP, "KEY_PAGE_UP"),
		GLFW_KEY_PAGE_DOWN to UserKey(GLFW_KEY_PAGE_DOWN, "KEY_PAGE_DOWN"),
		GLFW_KEY_HOME to UserKey(GLFW_KEY_HOME, "KEY_HOME"),
		GLFW_KEY_END to UserKey(GLFW_KEY_END, "KEY_END"),
		GLFW_KEY_CAPS_LOCK to UserKey(GLFW_KEY_CAPS_LOCK, "KEY_CAPS_LOCK"),
		GLFW_KEY_SCROLL_LOCK to UserKey(GLFW_KEY_SCROLL_LOCK, "KEY_SCROLL_LOCK"),
		GLFW_KEY_NUM_LOCK to UserKey(GLFW_KEY_NUM_LOCK, "KEY_NUM_LOCK"),
		GLFW_KEY_PRINT_SCREEN to UserKey(GLFW_KEY_PRINT_SCREEN, "KEY_PRINT_SCREEN"),
		GLFW_KEY_PAUSE to UserKey(GLFW_KEY_PAUSE, "KEY_PAUSE"),
		GLFW_KEY_F1 to UserKey(GLFW_KEY_F1, "KEY_F1"),
		GLFW_KEY_F2 to UserKey(GLFW_KEY_F2, "KEY_F2"),
		GLFW_KEY_F3 to UserKey(GLFW_KEY_F3, "KEY_F3"),
		GLFW_KEY_F4 to UserKey(GLFW_KEY_F4, "KEY_F4"),
		GLFW_KEY_F5 to UserKey(GLFW_KEY_F5, "KEY_F5"),
		GLFW_KEY_F6 to UserKey(GLFW_KEY_F6, "KEY_F6"),
		GLFW_KEY_F7 to UserKey(GLFW_KEY_F7, "KEY_F7"),
		GLFW_KEY_F8 to UserKey(GLFW_KEY_F8, "KEY_F8"),
		GLFW_KEY_F9 to UserKey(GLFW_KEY_F9, "KEY_F9"),
		GLFW_KEY_F10 to UserKey(GLFW_KEY_F10, "KEY_F10"),
		GLFW_KEY_F11 to UserKey(GLFW_KEY_F11, "KEY_F11"),
		GLFW_KEY_F12 to UserKey(GLFW_KEY_F12, "KEY_F12"),
		GLFW_KEY_F13 to UserKey(GLFW_KEY_F13, "KEY_F13"),
		GLFW_KEY_F14 to UserKey(GLFW_KEY_F14, "KEY_F14"),
		GLFW_KEY_F15 to UserKey(GLFW_KEY_F15, "KEY_F15"),
		GLFW_KEY_F16 to UserKey(GLFW_KEY_F16, "KEY_F16"),
		GLFW_KEY_F17 to UserKey(GLFW_KEY_F17, "KEY_F17"),
		GLFW_KEY_F18 to UserKey(GLFW_KEY_F18, "KEY_F18"),
		GLFW_KEY_F19 to UserKey(GLFW_KEY_F19, "KEY_F19"),
		GLFW_KEY_F20 to UserKey(GLFW_KEY_F20, "KEY_F20"),
		GLFW_KEY_F21 to UserKey(GLFW_KEY_F21, "KEY_F21"),
		GLFW_KEY_F22 to UserKey(GLFW_KEY_F22, "KEY_F22"),
		GLFW_KEY_F23 to UserKey(GLFW_KEY_F23, "KEY_F23"),
		GLFW_KEY_F24 to UserKey(GLFW_KEY_F24, "KEY_F24"),
		GLFW_KEY_F25 to UserKey(GLFW_KEY_F25, "KEY_F25"),
		GLFW_KEY_KP_0 to UserKey(GLFW_KEY_KP_0, "KEY_KP_0"),
		GLFW_KEY_KP_1 to UserKey(GLFW_KEY_KP_1, "KEY_KP_1"),
		GLFW_KEY_KP_2 to UserKey(GLFW_KEY_KP_2, "KEY_KP_2"),
		GLFW_KEY_KP_3 to UserKey(GLFW_KEY_KP_3, "KEY_KP_3"),
		GLFW_KEY_KP_4 to UserKey(GLFW_KEY_KP_4, "KEY_KP_4"),
		GLFW_KEY_KP_5 to UserKey(GLFW_KEY_KP_5, "KEY_KP_5"),
		GLFW_KEY_KP_6 to UserKey(GLFW_KEY_KP_6, "KEY_KP_6"),
		GLFW_KEY_KP_7 to UserKey(GLFW_KEY_KP_7, "KEY_KP_7"),
		GLFW_KEY_KP_8 to UserKey(GLFW_KEY_KP_8, "KEY_KP_8"),
		GLFW_KEY_KP_9 to UserKey(GLFW_KEY_KP_9, "KEY_KP_9"),
		GLFW_KEY_KP_DECIMAL to UserKey(GLFW_KEY_KP_DECIMAL, "KEY_KP_DECIMAL"),
		GLFW_KEY_KP_DIVIDE to UserKey(GLFW_KEY_KP_DIVIDE, "KEY_KP_DIVIDE"),
		GLFW_KEY_KP_MULTIPLY to UserKey(GLFW_KEY_KP_MULTIPLY, "KEY_KP_MULTIPLY"),
		GLFW_KEY_KP_SUBTRACT to UserKey(GLFW_KEY_KP_SUBTRACT, "KEY_KP_SUBTRACT"),
		GLFW_KEY_KP_ADD to UserKey(GLFW_KEY_KP_ADD, "KEY_KP_ADD"),
		GLFW_KEY_KP_ENTER to UserKey(GLFW_KEY_KP_ENTER, "KEY_KP_ENTER"),
		GLFW_KEY_KP_EQUAL to UserKey(GLFW_KEY_KP_EQUAL, "KEY_KP_EQUAL"),
		GLFW_KEY_LEFT_SHIFT to UserKey(GLFW_KEY_LEFT_SHIFT, "KEY_LEFT_SHIFT"),
		GLFW_KEY_LEFT_CONTROL to UserKey(GLFW_KEY_LEFT_CONTROL, "KEY_LEFT_CONTROL"),
		GLFW_KEY_LEFT_ALT to UserKey(GLFW_KEY_LEFT_ALT, "KEY_LEFT_ALT"),
		GLFW_KEY_LEFT_SUPER to UserKey(GLFW_KEY_LEFT_SUPER, "KEY_LEFT_SUPER"),
		GLFW_KEY_RIGHT_SHIFT to UserKey(GLFW_KEY_RIGHT_SHIFT, "KEY_RIGHT_SHIFT"),
		GLFW_KEY_RIGHT_CONTROL to UserKey(GLFW_KEY_RIGHT_CONTROL, "KEY_RIGHT_CONTROL"),
		GLFW_KEY_RIGHT_ALT to UserKey(GLFW_KEY_RIGHT_ALT, "KEY_RIGHT_ALT"),
		GLFW_KEY_RIGHT_SUPER to UserKey(GLFW_KEY_RIGHT_SUPER, "KEY_RIGHT_SUPER"),
		GLFW_KEY_MENU to UserKey(GLFW_KEY_MENU, "KEY_MENU"),

		GLFW_MOUSE_BUTTON_1 to UserKey(GLFW_MOUSE_BUTTON_1, "MOUSE_BUTTON_1", false),
		GLFW_MOUSE_BUTTON_2 to UserKey(GLFW_MOUSE_BUTTON_2, "MOUSE_BUTTON_2", false),
		GLFW_MOUSE_BUTTON_3 to UserKey(GLFW_MOUSE_BUTTON_3, "MOUSE_BUTTON_3", false),
		GLFW_MOUSE_BUTTON_4 to UserKey(GLFW_MOUSE_BUTTON_4, "MOUSE_BUTTON_4", false),
		GLFW_MOUSE_BUTTON_5 to UserKey(GLFW_MOUSE_BUTTON_5, "MOUSE_BUTTON_5", false),
		GLFW_MOUSE_BUTTON_6 to UserKey(GLFW_MOUSE_BUTTON_6, "MOUSE_BUTTON_6", false),
		GLFW_MOUSE_BUTTON_7 to UserKey(GLFW_MOUSE_BUTTON_7, "MOUSE_BUTTON_7", false),
		GLFW_MOUSE_BUTTON_8 to UserKey(GLFW_MOUSE_BUTTON_8, "MOUSE_BUTTON_8", false),
	)

	override val KEY_SPACE_DOWN by keyMap[GLFW_KEY_SPACE]!!.delegatePressed
	override val KEY_SPACE_DURATION by keyMap[GLFW_KEY_SPACE]!!.delegateHowLong
	override val KEY_APOSTROPHE_DOWN by keyMap[GLFW_KEY_APOSTROPHE]!!.delegatePressed
	override val KEY_APOSTROPHE_DURATION by keyMap[GLFW_KEY_APOSTROPHE]!!.delegateHowLong
	override val KEY_COMMA_DOWN by keyMap[GLFW_KEY_COMMA]!!.delegatePressed
	override val KEY_COMMA_DURATION by keyMap[GLFW_KEY_COMMA]!!.delegateHowLong
	override val KEY_MINUS_DOWN by keyMap[GLFW_KEY_MINUS]!!.delegatePressed
	override val KEY_MINUS_DURATION by keyMap[GLFW_KEY_MINUS]!!.delegateHowLong
	override val KEY_PERIOD_DOWN by keyMap[GLFW_KEY_PERIOD]!!.delegatePressed
	override val KEY_PERIOD_DURATION by keyMap[GLFW_KEY_PERIOD]!!.delegateHowLong
	override val KEY_SLASH_DOWN by keyMap[GLFW_KEY_SLASH]!!.delegatePressed
	override val KEY_SLASH_DURATION by keyMap[GLFW_KEY_SLASH]!!.delegateHowLong
	override val KEY_0_DOWN by keyMap[GLFW_KEY_0]!!.delegatePressed
	override val KEY_0_DURATION by keyMap[GLFW_KEY_0]!!.delegateHowLong
	override val KEY_1_DOWN by keyMap[GLFW_KEY_1]!!.delegatePressed
	override val KEY_1_DURATION by keyMap[GLFW_KEY_1]!!.delegateHowLong
	override val KEY_2_DOWN by keyMap[GLFW_KEY_2]!!.delegatePressed
	override val KEY_2_DURATION by keyMap[GLFW_KEY_2]!!.delegateHowLong
	override val KEY_3_DOWN by keyMap[GLFW_KEY_3]!!.delegatePressed
	override val KEY_3_DURATION by keyMap[GLFW_KEY_3]!!.delegateHowLong
	override val KEY_4_DOWN by keyMap[GLFW_KEY_4]!!.delegatePressed
	override val KEY_4_DURATION by keyMap[GLFW_KEY_4]!!.delegateHowLong
	override val KEY_5_DOWN by keyMap[GLFW_KEY_5]!!.delegatePressed
	override val KEY_5_DURATION by keyMap[GLFW_KEY_5]!!.delegateHowLong
	override val KEY_6_DOWN by keyMap[GLFW_KEY_6]!!.delegatePressed
	override val KEY_6_DURATION by keyMap[GLFW_KEY_6]!!.delegateHowLong
	override val KEY_7_DOWN by keyMap[GLFW_KEY_7]!!.delegatePressed
	override val KEY_7_DURATION by keyMap[GLFW_KEY_7]!!.delegateHowLong
	override val KEY_8_DOWN by keyMap[GLFW_KEY_8]!!.delegatePressed
	override val KEY_8_DURATION by keyMap[GLFW_KEY_8]!!.delegateHowLong
	override val KEY_9_DOWN by keyMap[GLFW_KEY_9]!!.delegatePressed
	override val KEY_9_DURATION by keyMap[GLFW_KEY_9]!!.delegateHowLong
	override val KEY_SEMICOLON_DOWN by keyMap[GLFW_KEY_SEMICOLON]!!.delegatePressed
	override val KEY_SEMICOLON_DURATION by keyMap[GLFW_KEY_SEMICOLON]!!.delegateHowLong
	override val KEY_EQUAL_DOWN by keyMap[GLFW_KEY_EQUAL]!!.delegatePressed
	override val KEY_EQUAL_DURATION by keyMap[GLFW_KEY_EQUAL]!!.delegateHowLong
	override val KEY_A_DOWN by keyMap[GLFW_KEY_A]!!.delegatePressed
	override val KEY_A_DURATION by keyMap[GLFW_KEY_A]!!.delegateHowLong
	override val KEY_B_DOWN by keyMap[GLFW_KEY_B]!!.delegatePressed
	override val KEY_B_DURATION by keyMap[GLFW_KEY_B]!!.delegateHowLong
	override val KEY_C_DOWN by keyMap[GLFW_KEY_C]!!.delegatePressed
	override val KEY_C_DURATION by keyMap[GLFW_KEY_C]!!.delegateHowLong
	override val KEY_D_DOWN by keyMap[GLFW_KEY_D]!!.delegatePressed
	override val KEY_D_DURATION by keyMap[GLFW_KEY_D]!!.delegateHowLong
	override val KEY_E_DOWN by keyMap[GLFW_KEY_E]!!.delegatePressed
	override val KEY_E_DURATION by keyMap[GLFW_KEY_E]!!.delegateHowLong
	override val KEY_F_DOWN by keyMap[GLFW_KEY_F]!!.delegatePressed
	override val KEY_F_DURATION by keyMap[GLFW_KEY_F]!!.delegateHowLong
	override val KEY_G_DOWN by keyMap[GLFW_KEY_G]!!.delegatePressed
	override val KEY_G_DURATION by keyMap[GLFW_KEY_G]!!.delegateHowLong
	override val KEY_H_DOWN by keyMap[GLFW_KEY_H]!!.delegatePressed
	override val KEY_H_DURATION by keyMap[GLFW_KEY_H]!!.delegateHowLong
	override val KEY_I_DOWN by keyMap[GLFW_KEY_I]!!.delegatePressed
	override val KEY_I_DURATION by keyMap[GLFW_KEY_I]!!.delegateHowLong
	override val KEY_J_DOWN by keyMap[GLFW_KEY_J]!!.delegatePressed
	override val KEY_J_DURATION by keyMap[GLFW_KEY_J]!!.delegateHowLong
	override val KEY_K_DOWN by keyMap[GLFW_KEY_K]!!.delegatePressed
	override val KEY_K_DURATION by keyMap[GLFW_KEY_K]!!.delegateHowLong
	override val KEY_L_DOWN by keyMap[GLFW_KEY_L]!!.delegatePressed
	override val KEY_L_DURATION by keyMap[GLFW_KEY_L]!!.delegateHowLong
	override val KEY_M_DOWN by keyMap[GLFW_KEY_M]!!.delegatePressed
	override val KEY_M_DURATION by keyMap[GLFW_KEY_M]!!.delegateHowLong
	override val KEY_N_DOWN by keyMap[GLFW_KEY_N]!!.delegatePressed
	override val KEY_N_DURATION by keyMap[GLFW_KEY_N]!!.delegateHowLong
	override val KEY_O_DOWN by keyMap[GLFW_KEY_O]!!.delegatePressed
	override val KEY_O_DURATION by keyMap[GLFW_KEY_O]!!.delegateHowLong
	override val KEY_P_DOWN by keyMap[GLFW_KEY_P]!!.delegatePressed
	override val KEY_P_DURATION by keyMap[GLFW_KEY_P]!!.delegateHowLong
	override val KEY_Q_DOWN by keyMap[GLFW_KEY_Q]!!.delegatePressed
	override val KEY_Q_DURATION by keyMap[GLFW_KEY_Q]!!.delegateHowLong
	override val KEY_R_DOWN by keyMap[GLFW_KEY_R]!!.delegatePressed
	override val KEY_R_DURATION by keyMap[GLFW_KEY_R]!!.delegateHowLong
	override val KEY_S_DOWN by keyMap[GLFW_KEY_S]!!.delegatePressed
	override val KEY_S_DURATION by keyMap[GLFW_KEY_S]!!.delegateHowLong
	override val KEY_T_DOWN by keyMap[GLFW_KEY_T]!!.delegatePressed
	override val KEY_T_DURATION by keyMap[GLFW_KEY_T]!!.delegateHowLong
	override val KEY_U_DOWN by keyMap[GLFW_KEY_U]!!.delegatePressed
	override val KEY_U_DURATION by keyMap[GLFW_KEY_U]!!.delegateHowLong
	override val KEY_V_DOWN by keyMap[GLFW_KEY_V]!!.delegatePressed
	override val KEY_V_DURATION by keyMap[GLFW_KEY_V]!!.delegateHowLong
	override val KEY_W_DOWN by keyMap[GLFW_KEY_W]!!.delegatePressed
	override val KEY_W_DURATION by keyMap[GLFW_KEY_W]!!.delegateHowLong
	override val KEY_X_DOWN by keyMap[GLFW_KEY_X]!!.delegatePressed
	override val KEY_X_DURATION by keyMap[GLFW_KEY_X]!!.delegateHowLong
	override val KEY_Y_DOWN by keyMap[GLFW_KEY_Y]!!.delegatePressed
	override val KEY_Y_DURATION by keyMap[GLFW_KEY_Y]!!.delegateHowLong
	override val KEY_Z_DOWN by keyMap[GLFW_KEY_Z]!!.delegatePressed
	override val KEY_Z_DURATION by keyMap[GLFW_KEY_Z]!!.delegateHowLong
	override val KEY_LEFT_BRACKET_DOWN by keyMap[GLFW_KEY_LEFT_BRACKET]!!.delegatePressed
	override val KEY_LEFT_BRACKET_DURATION by keyMap[GLFW_KEY_LEFT_BRACKET]!!.delegateHowLong
	override val KEY_BACKSLASH_DOWN by keyMap[GLFW_KEY_BACKSLASH]!!.delegatePressed
	override val KEY_BACKSLASH_DURATION by keyMap[GLFW_KEY_BACKSLASH]!!.delegateHowLong
	override val KEY_RIGHT_BRACKET_DOWN by keyMap[GLFW_KEY_RIGHT_BRACKET]!!.delegatePressed
	override val KEY_RIGHT_BRACKET_DURATION by keyMap[GLFW_KEY_RIGHT_BRACKET]!!.delegateHowLong
	override val KEY_GRAVE_ACCENT_DOWN by keyMap[GLFW_KEY_GRAVE_ACCENT]!!.delegatePressed
	override val KEY_GRAVE_ACCENT_DURATION by keyMap[GLFW_KEY_GRAVE_ACCENT]!!.delegateHowLong
	override val KEY_WORLD_1_DOWN by keyMap[GLFW_KEY_WORLD_1]!!.delegatePressed
	override val KEY_WORLD_1_DURATION by keyMap[GLFW_KEY_WORLD_1]!!.delegateHowLong
	override val KEY_WORLD_2_DOWN by keyMap[GLFW_KEY_WORLD_2]!!.delegatePressed
	override val KEY_WORLD_2_DURATION by keyMap[GLFW_KEY_WORLD_2]!!.delegateHowLong
	override val KEY_ESCAPE_DOWN by keyMap[GLFW_KEY_ESCAPE]!!.delegatePressed
	override val KEY_ESCAPE_DURATION by keyMap[GLFW_KEY_ESCAPE]!!.delegateHowLong
	override val KEY_ENTER_DOWN by keyMap[GLFW_KEY_ENTER]!!.delegatePressed
	override val KEY_ENTER_DURATION by keyMap[GLFW_KEY_ENTER]!!.delegateHowLong
	override val KEY_TAB_DOWN by keyMap[GLFW_KEY_TAB]!!.delegatePressed
	override val KEY_TAB_DURATION by keyMap[GLFW_KEY_TAB]!!.delegateHowLong
	override val KEY_BACKSPACE_DOWN by keyMap[GLFW_KEY_BACKSPACE]!!.delegatePressed
	override val KEY_BACKSPACE_DURATION by keyMap[GLFW_KEY_BACKSPACE]!!.delegateHowLong
	override val KEY_INSERT_DOWN by keyMap[GLFW_KEY_INSERT]!!.delegatePressed
	override val KEY_INSERT_DURATION by keyMap[GLFW_KEY_INSERT]!!.delegateHowLong
	override val KEY_DELETE_DOWN by keyMap[GLFW_KEY_DELETE]!!.delegatePressed
	override val KEY_DELETE_DURATION by keyMap[GLFW_KEY_DELETE]!!.delegateHowLong
	override val KEY_RIGHT_DOWN by keyMap[GLFW_KEY_RIGHT]!!.delegatePressed
	override val KEY_RIGHT_DURATION by keyMap[GLFW_KEY_RIGHT]!!.delegateHowLong
	override val KEY_LEFT_DOWN by keyMap[GLFW_KEY_LEFT]!!.delegatePressed
	override val KEY_LEFT_DURATION by keyMap[GLFW_KEY_LEFT]!!.delegateHowLong
	override val KEY_DOWN_DOWN by keyMap[GLFW_KEY_DOWN]!!.delegatePressed
	override val KEY_DOWN_DURATION by keyMap[GLFW_KEY_DOWN]!!.delegateHowLong
	override val KEY_UP_DOWN by keyMap[GLFW_KEY_UP]!!.delegatePressed
	override val KEY_UP_DURATION by keyMap[GLFW_KEY_UP]!!.delegateHowLong
	override val KEY_PAGE_UP_DOWN by keyMap[GLFW_KEY_PAGE_UP]!!.delegatePressed
	override val KEY_PAGE_UP_DURATION by keyMap[GLFW_KEY_PAGE_UP]!!.delegateHowLong
	override val KEY_PAGE_DOWN_DOWN by keyMap[GLFW_KEY_PAGE_DOWN]!!.delegatePressed
	override val KEY_PAGE_DOWN_DURATION by keyMap[GLFW_KEY_PAGE_DOWN]!!.delegateHowLong
	override val KEY_HOME_DOWN by keyMap[GLFW_KEY_HOME]!!.delegatePressed
	override val KEY_HOME_DURATION by keyMap[GLFW_KEY_HOME]!!.delegateHowLong
	override val KEY_END_DOWN by keyMap[GLFW_KEY_END]!!.delegatePressed
	override val KEY_END_DURATION by keyMap[GLFW_KEY_END]!!.delegateHowLong
	override val KEY_CAPS_LOCK_DOWN by keyMap[GLFW_KEY_CAPS_LOCK]!!.delegatePressed
	override val KEY_CAPS_LOCK_DURATION by keyMap[GLFW_KEY_CAPS_LOCK]!!.delegateHowLong
	override val KEY_SCROLL_LOCK_DOWN by keyMap[GLFW_KEY_SCROLL_LOCK]!!.delegatePressed
	override val KEY_SCROLL_LOCK_DURATION by keyMap[GLFW_KEY_SCROLL_LOCK]!!.delegateHowLong
	override val KEY_NUM_LOCK_DOWN by keyMap[GLFW_KEY_NUM_LOCK]!!.delegatePressed
	override val KEY_NUM_LOCK_DURATION by keyMap[GLFW_KEY_NUM_LOCK]!!.delegateHowLong
	override val KEY_PRINT_SCREEN_DOWN by keyMap[GLFW_KEY_PRINT_SCREEN]!!.delegatePressed
	override val KEY_PRINT_SCREEN_DURATION by keyMap[GLFW_KEY_PRINT_SCREEN]!!.delegateHowLong
	override val KEY_PAUSE_DOWN by keyMap[GLFW_KEY_PAUSE]!!.delegatePressed
	override val KEY_PAUSE_DURATION by keyMap[GLFW_KEY_PAUSE]!!.delegateHowLong
	override val KEY_F1_DOWN by keyMap[GLFW_KEY_F1]!!.delegatePressed
	override val KEY_F1_DURATION by keyMap[GLFW_KEY_F1]!!.delegateHowLong
	override val KEY_F2_DOWN by keyMap[GLFW_KEY_F2]!!.delegatePressed
	override val KEY_F2_DURATION by keyMap[GLFW_KEY_F2]!!.delegateHowLong
	override val KEY_F3_DOWN by keyMap[GLFW_KEY_F3]!!.delegatePressed
	override val KEY_F3_DURATION by keyMap[GLFW_KEY_F3]!!.delegateHowLong
	override val KEY_F4_DOWN by keyMap[GLFW_KEY_F4]!!.delegatePressed
	override val KEY_F4_DURATION by keyMap[GLFW_KEY_F4]!!.delegateHowLong
	override val KEY_F5_DOWN by keyMap[GLFW_KEY_F5]!!.delegatePressed
	override val KEY_F5_DURATION by keyMap[GLFW_KEY_F5]!!.delegateHowLong
	override val KEY_F6_DOWN by keyMap[GLFW_KEY_F6]!!.delegatePressed
	override val KEY_F6_DURATION by keyMap[GLFW_KEY_F6]!!.delegateHowLong
	override val KEY_F7_DOWN by keyMap[GLFW_KEY_F7]!!.delegatePressed
	override val KEY_F7_DURATION by keyMap[GLFW_KEY_F7]!!.delegateHowLong
	override val KEY_F8_DOWN by keyMap[GLFW_KEY_F8]!!.delegatePressed
	override val KEY_F8_DURATION by keyMap[GLFW_KEY_F8]!!.delegateHowLong
	override val KEY_F9_DOWN by keyMap[GLFW_KEY_F9]!!.delegatePressed
	override val KEY_F9_DURATION by keyMap[GLFW_KEY_F9]!!.delegateHowLong
	override val KEY_F10_DOWN by keyMap[GLFW_KEY_F10]!!.delegatePressed
	override val KEY_F10_DURATION by keyMap[GLFW_KEY_F10]!!.delegateHowLong
	override val KEY_F11_DOWN by keyMap[GLFW_KEY_F11]!!.delegatePressed
	override val KEY_F11_DURATION by keyMap[GLFW_KEY_F11]!!.delegateHowLong
	override val KEY_F12_DOWN by keyMap[GLFW_KEY_F12]!!.delegatePressed
	override val KEY_F12_DURATION by keyMap[GLFW_KEY_F12]!!.delegateHowLong
	override val KEY_F13_DOWN by keyMap[GLFW_KEY_F13]!!.delegatePressed
	override val KEY_F13_DURATION by keyMap[GLFW_KEY_F13]!!.delegateHowLong
	override val KEY_F14_DOWN by keyMap[GLFW_KEY_F14]!!.delegatePressed
	override val KEY_F14_DURATION by keyMap[GLFW_KEY_F14]!!.delegateHowLong
	override val KEY_F15_DOWN by keyMap[GLFW_KEY_F15]!!.delegatePressed
	override val KEY_F15_DURATION by keyMap[GLFW_KEY_F15]!!.delegateHowLong
	override val KEY_F16_DOWN by keyMap[GLFW_KEY_F16]!!.delegatePressed
	override val KEY_F16_DURATION by keyMap[GLFW_KEY_F16]!!.delegateHowLong
	override val KEY_F17_DOWN by keyMap[GLFW_KEY_F17]!!.delegatePressed
	override val KEY_F17_DURATION by keyMap[GLFW_KEY_F17]!!.delegateHowLong
	override val KEY_F18_DOWN by keyMap[GLFW_KEY_F18]!!.delegatePressed
	override val KEY_F18_DURATION by keyMap[GLFW_KEY_F18]!!.delegateHowLong
	override val KEY_F19_DOWN by keyMap[GLFW_KEY_F19]!!.delegatePressed
	override val KEY_F19_DURATION by keyMap[GLFW_KEY_F19]!!.delegateHowLong
	override val KEY_F20_DOWN by keyMap[GLFW_KEY_F20]!!.delegatePressed
	override val KEY_F20_DURATION by keyMap[GLFW_KEY_F20]!!.delegateHowLong
	override val KEY_F21_DOWN by keyMap[GLFW_KEY_F21]!!.delegatePressed
	override val KEY_F21_DURATION by keyMap[GLFW_KEY_F21]!!.delegateHowLong
	override val KEY_F22_DOWN by keyMap[GLFW_KEY_F22]!!.delegatePressed
	override val KEY_F22_DURATION by keyMap[GLFW_KEY_F22]!!.delegateHowLong
	override val KEY_F23_DOWN by keyMap[GLFW_KEY_F23]!!.delegatePressed
	override val KEY_F23_DURATION by keyMap[GLFW_KEY_F23]!!.delegateHowLong
	override val KEY_F24_DOWN by keyMap[GLFW_KEY_F24]!!.delegatePressed
	override val KEY_F24_DURATION by keyMap[GLFW_KEY_F24]!!.delegateHowLong
	override val KEY_F25_DOWN by keyMap[GLFW_KEY_F25]!!.delegatePressed
	override val KEY_F25_DURATION by keyMap[GLFW_KEY_F25]!!.delegateHowLong
	override val KEY_KP_0_DOWN by keyMap[GLFW_KEY_KP_0]!!.delegatePressed
	override val KEY_KP_0_DURATION by keyMap[GLFW_KEY_KP_0]!!.delegateHowLong
	override val KEY_KP_1_DOWN by keyMap[GLFW_KEY_KP_1]!!.delegatePressed
	override val KEY_KP_1_DURATION by keyMap[GLFW_KEY_KP_1]!!.delegateHowLong
	override val KEY_KP_2_DOWN by keyMap[GLFW_KEY_KP_2]!!.delegatePressed
	override val KEY_KP_2_DURATION by keyMap[GLFW_KEY_KP_2]!!.delegateHowLong
	override val KEY_KP_3_DOWN by keyMap[GLFW_KEY_KP_3]!!.delegatePressed
	override val KEY_KP_3_DURATION by keyMap[GLFW_KEY_KP_3]!!.delegateHowLong
	override val KEY_KP_4_DOWN by keyMap[GLFW_KEY_KP_4]!!.delegatePressed
	override val KEY_KP_4_DURATION by keyMap[GLFW_KEY_KP_4]!!.delegateHowLong
	override val KEY_KP_5_DOWN by keyMap[GLFW_KEY_KP_5]!!.delegatePressed
	override val KEY_KP_5_DURATION by keyMap[GLFW_KEY_KP_5]!!.delegateHowLong
	override val KEY_KP_6_DOWN by keyMap[GLFW_KEY_KP_6]!!.delegatePressed
	override val KEY_KP_6_DURATION by keyMap[GLFW_KEY_KP_6]!!.delegateHowLong
	override val KEY_KP_7_DOWN by keyMap[GLFW_KEY_KP_7]!!.delegatePressed
	override val KEY_KP_7_DURATION by keyMap[GLFW_KEY_KP_7]!!.delegateHowLong
	override val KEY_KP_8_DOWN by keyMap[GLFW_KEY_KP_8]!!.delegatePressed
	override val KEY_KP_8_DURATION by keyMap[GLFW_KEY_KP_8]!!.delegateHowLong
	override val KEY_KP_9_DOWN by keyMap[GLFW_KEY_KP_9]!!.delegatePressed
	override val KEY_KP_9_DURATION by keyMap[GLFW_KEY_KP_9]!!.delegateHowLong
	override val KEY_KP_DECIMAL_DOWN by keyMap[GLFW_KEY_KP_DECIMAL]!!.delegatePressed
	override val KEY_KP_DECIMAL_DURATION by keyMap[GLFW_KEY_KP_DECIMAL]!!.delegateHowLong
	override val KEY_KP_DIVIDE_DOWN by keyMap[GLFW_KEY_KP_DIVIDE]!!.delegatePressed
	override val KEY_KP_DIVIDE_DURATION by keyMap[GLFW_KEY_KP_DIVIDE]!!.delegateHowLong
	override val KEY_KP_MULTIPLY_DOWN by keyMap[GLFW_KEY_KP_MULTIPLY]!!.delegatePressed
	override val KEY_KP_MULTIPLY_DURATION by keyMap[GLFW_KEY_KP_MULTIPLY]!!.delegateHowLong
	override val KEY_KP_SUBTRACT_DOWN by keyMap[GLFW_KEY_KP_SUBTRACT]!!.delegatePressed
	override val KEY_KP_SUBTRACT_DURATION by keyMap[GLFW_KEY_KP_SUBTRACT]!!.delegateHowLong
	override val KEY_KP_ADD_DOWN by keyMap[GLFW_KEY_KP_ADD]!!.delegatePressed
	override val KEY_KP_ADD_DURATION by keyMap[GLFW_KEY_KP_ADD]!!.delegateHowLong
	override val KEY_KP_ENTER_DOWN by keyMap[GLFW_KEY_KP_ENTER]!!.delegatePressed
	override val KEY_KP_ENTER_DURATION by keyMap[GLFW_KEY_KP_ENTER]!!.delegateHowLong
	override val KEY_KP_EQUAL_DOWN by keyMap[GLFW_KEY_KP_EQUAL]!!.delegatePressed
	override val KEY_KP_EQUAL_DURATION by keyMap[GLFW_KEY_KP_EQUAL]!!.delegateHowLong
	override val KEY_LEFT_SHIFT_DOWN by keyMap[GLFW_KEY_LEFT_SHIFT]!!.delegatePressed
	override val KEY_LEFT_SHIFT_DURATION by keyMap[GLFW_KEY_LEFT_SHIFT]!!.delegateHowLong
	override val KEY_LEFT_CONTROL_DOWN by keyMap[GLFW_KEY_LEFT_CONTROL]!!.delegatePressed
	override val KEY_LEFT_CONTROL_DURATION by keyMap[GLFW_KEY_LEFT_CONTROL]!!.delegateHowLong
	override val KEY_LEFT_ALT_DOWN by keyMap[GLFW_KEY_LEFT_ALT]!!.delegatePressed
	override val KEY_LEFT_ALT_DURATION by keyMap[GLFW_KEY_LEFT_ALT]!!.delegateHowLong
	override val KEY_LEFT_SUPER_DOWN by keyMap[GLFW_KEY_LEFT_SUPER]!!.delegatePressed
	override val KEY_LEFT_SUPER_DURATION by keyMap[GLFW_KEY_LEFT_SUPER]!!.delegateHowLong
	override val KEY_RIGHT_SHIFT_DOWN by keyMap[GLFW_KEY_RIGHT_SHIFT]!!.delegatePressed
	override val KEY_RIGHT_SHIFT_DURATION by keyMap[GLFW_KEY_RIGHT_SHIFT]!!.delegateHowLong
	override val KEY_RIGHT_CONTROL_DOWN by keyMap[GLFW_KEY_RIGHT_CONTROL]!!.delegatePressed
	override val KEY_RIGHT_CONTROL_DURATION by keyMap[GLFW_KEY_RIGHT_CONTROL]!!.delegateHowLong
	override val KEY_RIGHT_ALT_DOWN by keyMap[GLFW_KEY_RIGHT_ALT]!!.delegatePressed
	override val KEY_RIGHT_ALT_DURATION by keyMap[GLFW_KEY_RIGHT_ALT]!!.delegateHowLong
	override val KEY_RIGHT_SUPER_DOWN by keyMap[GLFW_KEY_RIGHT_SUPER]!!.delegatePressed
	override val KEY_RIGHT_SUPER_DURATION by keyMap[GLFW_KEY_RIGHT_SUPER]!!.delegateHowLong
	override val KEY_MENU_DOWN by keyMap[GLFW_KEY_MENU]!!.delegatePressed
	override val KEY_MENU_DURATION by keyMap[GLFW_KEY_MENU]!!.delegateHowLong
	override val KEY_LAST_DOWN by keyMap[GLFW_KEY_LAST]!!.delegatePressed
	override val KEY_LAST_DURATION by keyMap[GLFW_KEY_LAST]!!.delegateHowLong
	override val MOUSE_BUTTON_1_DOWN by keyMap[GLFW_MOUSE_BUTTON_1]!!.delegatePressed
	override val MOUSE_BUTTON_1_DURATION by keyMap[GLFW_MOUSE_BUTTON_1]!!.delegateHowLong
	override val MOUSE_BUTTON_2_DOWN by keyMap[GLFW_MOUSE_BUTTON_2]!!.delegatePressed
	override val MOUSE_BUTTON_2_DURATION by keyMap[GLFW_MOUSE_BUTTON_2]!!.delegateHowLong
	override val MOUSE_BUTTON_3_DOWN by keyMap[GLFW_MOUSE_BUTTON_3]!!.delegatePressed
	override val MOUSE_BUTTON_3_DURATION by keyMap[GLFW_MOUSE_BUTTON_3]!!.delegateHowLong
	override val MOUSE_BUTTON_4_DOWN by keyMap[GLFW_MOUSE_BUTTON_4]!!.delegatePressed
	override val MOUSE_BUTTON_4_DURATION by keyMap[GLFW_MOUSE_BUTTON_4]!!.delegateHowLong
	override val MOUSE_BUTTON_5_DOWN by keyMap[GLFW_MOUSE_BUTTON_5]!!.delegatePressed
	override val MOUSE_BUTTON_5_DURATION by keyMap[GLFW_MOUSE_BUTTON_5]!!.delegateHowLong
	override val MOUSE_BUTTON_6_DOWN by keyMap[GLFW_MOUSE_BUTTON_6]!!.delegatePressed
	override val MOUSE_BUTTON_6_DURATION by keyMap[GLFW_MOUSE_BUTTON_6]!!.delegateHowLong
	override val MOUSE_BUTTON_7_DOWN by keyMap[GLFW_MOUSE_BUTTON_7]!!.delegatePressed
	override val MOUSE_BUTTON_7_DURATION by keyMap[GLFW_MOUSE_BUTTON_7]!!.delegateHowLong
	override val MOUSE_BUTTON_8_DOWN by keyMap[GLFW_MOUSE_BUTTON_8]!!.delegatePressed
	override val MOUSE_BUTTON_8_DURATION by keyMap[GLFW_MOUSE_BUTTON_8]!!.delegateHowLong


	override val KEY_SPACE_PRESSED: Boolean by keyMap[GLFW_KEY_SPACE]!!.delegatePressedRightAway
	override val KEY_APOSTROPHE_PRESSED: Boolean by keyMap[GLFW_KEY_APOSTROPHE]!!.delegatePressedRightAway
	override val KEY_COMMA_PRESSED: Boolean by keyMap[GLFW_KEY_COMMA]!!.delegatePressedRightAway
	override val KEY_MINUS_PRESSED: Boolean by keyMap[GLFW_KEY_MINUS]!!.delegatePressedRightAway
	override val KEY_PERIOD_PRESSED: Boolean by keyMap[GLFW_KEY_PERIOD]!!.delegatePressedRightAway
	override val KEY_SLASH_PRESSED: Boolean by keyMap[GLFW_KEY_SLASH]!!.delegatePressedRightAway
	override val KEY_0_PRESSED: Boolean by keyMap[GLFW_KEY_0]!!.delegatePressedRightAway
	override val KEY_1_PRESSED: Boolean by keyMap[GLFW_KEY_1]!!.delegatePressedRightAway
	override val KEY_2_PRESSED: Boolean by keyMap[GLFW_KEY_2]!!.delegatePressedRightAway
	override val KEY_3_PRESSED: Boolean by keyMap[GLFW_KEY_3]!!.delegatePressedRightAway
	override val KEY_4_PRESSED: Boolean by keyMap[GLFW_KEY_4]!!.delegatePressedRightAway
	override val KEY_5_PRESSED: Boolean by keyMap[GLFW_KEY_5]!!.delegatePressedRightAway
	override val KEY_6_PRESSED: Boolean by keyMap[GLFW_KEY_6]!!.delegatePressedRightAway
	override val KEY_7_PRESSED: Boolean by keyMap[GLFW_KEY_7]!!.delegatePressedRightAway
	override val KEY_8_PRESSED: Boolean by keyMap[GLFW_KEY_8]!!.delegatePressedRightAway
	override val KEY_9_PRESSED: Boolean by keyMap[GLFW_KEY_9]!!.delegatePressedRightAway
	override val KEY_SEMICOLON_PRESSED: Boolean by keyMap[GLFW_KEY_SEMICOLON]!!.delegatePressedRightAway
	override val KEY_EQUAL_PRESSED: Boolean by keyMap[GLFW_KEY_EQUAL]!!.delegatePressedRightAway
	override val KEY_A_PRESSED: Boolean by keyMap[GLFW_KEY_A]!!.delegatePressedRightAway
	override val KEY_B_PRESSED: Boolean by keyMap[GLFW_KEY_B]!!.delegatePressedRightAway
	override val KEY_C_PRESSED: Boolean by keyMap[GLFW_KEY_C]!!.delegatePressedRightAway
	override val KEY_D_PRESSED: Boolean by keyMap[GLFW_KEY_D]!!.delegatePressedRightAway
	override val KEY_E_PRESSED: Boolean by keyMap[GLFW_KEY_E]!!.delegatePressedRightAway
	override val KEY_F_PRESSED: Boolean by keyMap[GLFW_KEY_F]!!.delegatePressedRightAway
	override val KEY_G_PRESSED: Boolean by keyMap[GLFW_KEY_G]!!.delegatePressedRightAway
	override val KEY_H_PRESSED: Boolean by keyMap[GLFW_KEY_H]!!.delegatePressedRightAway
	override val KEY_I_PRESSED: Boolean by keyMap[GLFW_KEY_I]!!.delegatePressedRightAway
	override val KEY_J_PRESSED: Boolean by keyMap[GLFW_KEY_J]!!.delegatePressedRightAway
	override val KEY_K_PRESSED: Boolean by keyMap[GLFW_KEY_K]!!.delegatePressedRightAway
	override val KEY_L_PRESSED: Boolean by keyMap[GLFW_KEY_L]!!.delegatePressedRightAway
	override val KEY_M_PRESSED: Boolean by keyMap[GLFW_KEY_M]!!.delegatePressedRightAway
	override val KEY_N_PRESSED: Boolean by keyMap[GLFW_KEY_N]!!.delegatePressedRightAway
	override val KEY_O_PRESSED: Boolean by keyMap[GLFW_KEY_O]!!.delegatePressedRightAway
	override val KEY_P_PRESSED: Boolean by keyMap[GLFW_KEY_P]!!.delegatePressedRightAway
	override val KEY_Q_PRESSED: Boolean by keyMap[GLFW_KEY_Q]!!.delegatePressedRightAway
	override val KEY_R_PRESSED: Boolean by keyMap[GLFW_KEY_R]!!.delegatePressedRightAway
	override val KEY_S_PRESSED: Boolean by keyMap[GLFW_KEY_S]!!.delegatePressedRightAway
	override val KEY_T_PRESSED: Boolean by keyMap[GLFW_KEY_T]!!.delegatePressedRightAway
	override val KEY_U_PRESSED: Boolean by keyMap[GLFW_KEY_U]!!.delegatePressedRightAway
	override val KEY_V_PRESSED: Boolean by keyMap[GLFW_KEY_V]!!.delegatePressedRightAway
	override val KEY_W_PRESSED: Boolean by keyMap[GLFW_KEY_W]!!.delegatePressedRightAway
	override val KEY_X_PRESSED: Boolean by keyMap[GLFW_KEY_X]!!.delegatePressedRightAway
	override val KEY_Y_PRESSED: Boolean by keyMap[GLFW_KEY_Y]!!.delegatePressedRightAway
	override val KEY_Z_PRESSED: Boolean by keyMap[GLFW_KEY_Z]!!.delegatePressedRightAway
	override val KEY_LEFT_BRACKET_PRESSED: Boolean by keyMap[GLFW_KEY_LEFT_BRACKET]!!.delegatePressedRightAway
	override val KEY_BACKSLASH_PRESSED: Boolean by keyMap[GLFW_KEY_BACKSLASH]!!.delegatePressedRightAway
	override val KEY_RIGHT_BRACKET_PRESSED: Boolean by keyMap[GLFW_KEY_RIGHT_BRACKET]!!.delegatePressedRightAway
	override val KEY_GRAVE_ACCENT_PRESSED: Boolean by keyMap[GLFW_KEY_GRAVE_ACCENT]!!.delegatePressedRightAway
	override val KEY_WORLD_1_PRESSED: Boolean by keyMap[GLFW_KEY_WORLD_1]!!.delegatePressedRightAway
	override val KEY_WORLD_2_PRESSED: Boolean by keyMap[GLFW_KEY_WORLD_2]!!.delegatePressedRightAway
	override val KEY_ESCAPE_PRESSED: Boolean by keyMap[GLFW_KEY_ESCAPE]!!.delegatePressedRightAway
	override val KEY_ENTER_PRESSED: Boolean by keyMap[GLFW_KEY_ENTER]!!.delegatePressedRightAway
	override val KEY_TAB_PRESSED: Boolean by keyMap[GLFW_KEY_TAB]!!.delegatePressedRightAway
	override val KEY_BACKSPACE_PRESSED: Boolean by keyMap[GLFW_KEY_BACKSPACE]!!.delegatePressedRightAway
	override val KEY_INSERT_PRESSED: Boolean by keyMap[GLFW_KEY_INSERT]!!.delegatePressedRightAway
	override val KEY_DELETE_PRESSED: Boolean by keyMap[GLFW_KEY_DELETE]!!.delegatePressedRightAway
	override val KEY_RIGHT_PRESSED: Boolean by keyMap[GLFW_KEY_RIGHT]!!.delegatePressedRightAway
	override val KEY_LEFT_PRESSED: Boolean by keyMap[GLFW_KEY_LEFT]!!.delegatePressedRightAway
	override val KEY_DOWN_PRESSED: Boolean by keyMap[GLFW_KEY_DOWN]!!.delegatePressedRightAway
	override val KEY_UP_PRESSED: Boolean by keyMap[GLFW_KEY_UP]!!.delegatePressedRightAway
	override val KEY_PAGE_UP_PRESSED: Boolean by keyMap[GLFW_KEY_PAGE_UP]!!.delegatePressedRightAway
	override val KEY_PAGE_DOWN_PRESSED: Boolean by keyMap[GLFW_KEY_PAGE_DOWN]!!.delegatePressedRightAway
	override val KEY_HOME_PRESSED: Boolean by keyMap[GLFW_KEY_HOME]!!.delegatePressedRightAway
	override val KEY_END_PRESSED: Boolean by keyMap[GLFW_KEY_END]!!.delegatePressedRightAway
	override val KEY_CAPS_LOCK_PRESSED: Boolean by keyMap[GLFW_KEY_CAPS_LOCK]!!.delegatePressedRightAway
	override val KEY_SCROLL_LOCK_PRESSED: Boolean by keyMap[GLFW_KEY_SCROLL_LOCK]!!.delegatePressedRightAway
	override val KEY_NUM_LOCK_PRESSED: Boolean by keyMap[GLFW_KEY_NUM_LOCK]!!.delegatePressedRightAway
	override val KEY_PRINT_SCREEN_PRESSED: Boolean by keyMap[GLFW_KEY_PRINT_SCREEN]!!.delegatePressedRightAway
	override val KEY_PAUSE_PRESSED: Boolean by keyMap[GLFW_KEY_PAUSE]!!.delegatePressedRightAway
	override val KEY_F1_PRESSED: Boolean by keyMap[GLFW_KEY_F1]!!.delegatePressedRightAway
	override val KEY_F2_PRESSED: Boolean by keyMap[GLFW_KEY_F2]!!.delegatePressedRightAway
	override val KEY_F3_PRESSED: Boolean by keyMap[GLFW_KEY_F3]!!.delegatePressedRightAway
	override val KEY_F4_PRESSED: Boolean by keyMap[GLFW_KEY_F4]!!.delegatePressedRightAway
	override val KEY_F5_PRESSED: Boolean by keyMap[GLFW_KEY_F5]!!.delegatePressedRightAway
	override val KEY_F6_PRESSED: Boolean by keyMap[GLFW_KEY_F6]!!.delegatePressedRightAway
	override val KEY_F7_PRESSED: Boolean by keyMap[GLFW_KEY_F7]!!.delegatePressedRightAway
	override val KEY_F8_PRESSED: Boolean by keyMap[GLFW_KEY_F8]!!.delegatePressedRightAway
	override val KEY_F9_PRESSED: Boolean by keyMap[GLFW_KEY_F9]!!.delegatePressedRightAway
	override val KEY_F10_PRESSED: Boolean by keyMap[GLFW_KEY_F10]!!.delegatePressedRightAway
	override val KEY_F11_PRESSED: Boolean by keyMap[GLFW_KEY_F11]!!.delegatePressedRightAway
	override val KEY_F12_PRESSED: Boolean by keyMap[GLFW_KEY_F12]!!.delegatePressedRightAway
	override val KEY_F13_PRESSED: Boolean by keyMap[GLFW_KEY_F13]!!.delegatePressedRightAway
	override val KEY_F14_PRESSED: Boolean by keyMap[GLFW_KEY_F14]!!.delegatePressedRightAway
	override val KEY_F15_PRESSED: Boolean by keyMap[GLFW_KEY_F15]!!.delegatePressedRightAway
	override val KEY_F16_PRESSED: Boolean by keyMap[GLFW_KEY_F16]!!.delegatePressedRightAway
	override val KEY_F17_PRESSED: Boolean by keyMap[GLFW_KEY_F17]!!.delegatePressedRightAway
	override val KEY_F18_PRESSED: Boolean by keyMap[GLFW_KEY_F18]!!.delegatePressedRightAway
	override val KEY_F19_PRESSED: Boolean by keyMap[GLFW_KEY_F19]!!.delegatePressedRightAway
	override val KEY_F20_PRESSED: Boolean by keyMap[GLFW_KEY_F20]!!.delegatePressedRightAway
	override val KEY_F21_PRESSED: Boolean by keyMap[GLFW_KEY_F21]!!.delegatePressedRightAway
	override val KEY_F22_PRESSED: Boolean by keyMap[GLFW_KEY_F22]!!.delegatePressedRightAway
	override val KEY_F23_PRESSED: Boolean by keyMap[GLFW_KEY_F23]!!.delegatePressedRightAway
	override val KEY_F24_PRESSED: Boolean by keyMap[GLFW_KEY_F24]!!.delegatePressedRightAway
	override val KEY_F25_PRESSED: Boolean by keyMap[GLFW_KEY_F25]!!.delegatePressedRightAway
	override val KEY_KP_0_PRESSED: Boolean by keyMap[GLFW_KEY_KP_0]!!.delegatePressedRightAway
	override val KEY_KP_1_PRESSED: Boolean by keyMap[GLFW_KEY_KP_1]!!.delegatePressedRightAway
	override val KEY_KP_2_PRESSED: Boolean by keyMap[GLFW_KEY_KP_2]!!.delegatePressedRightAway
	override val KEY_KP_3_PRESSED: Boolean by keyMap[GLFW_KEY_KP_3]!!.delegatePressedRightAway
	override val KEY_KP_4_PRESSED: Boolean by keyMap[GLFW_KEY_KP_4]!!.delegatePressedRightAway
	override val KEY_KP_5_PRESSED: Boolean by keyMap[GLFW_KEY_KP_5]!!.delegatePressedRightAway
	override val KEY_KP_6_PRESSED: Boolean by keyMap[GLFW_KEY_KP_6]!!.delegatePressedRightAway
	override val KEY_KP_7_PRESSED: Boolean by keyMap[GLFW_KEY_KP_7]!!.delegatePressedRightAway
	override val KEY_KP_8_PRESSED: Boolean by keyMap[GLFW_KEY_KP_8]!!.delegatePressedRightAway
	override val KEY_KP_9_PRESSED: Boolean by keyMap[GLFW_KEY_KP_9]!!.delegatePressedRightAway
	override val KEY_KP_DECIMAL_PRESSED: Boolean by keyMap[GLFW_KEY_KP_DECIMAL]!!.delegatePressedRightAway
	override val KEY_KP_DIVIDE_PRESSED: Boolean by keyMap[GLFW_KEY_KP_DIVIDE]!!.delegatePressedRightAway
	override val KEY_KP_MULTIPLY_PRESSED: Boolean by keyMap[GLFW_KEY_KP_MULTIPLY]!!.delegatePressedRightAway
	override val KEY_KP_SUBTRACT_PRESSED: Boolean by keyMap[GLFW_KEY_KP_SUBTRACT]!!.delegatePressedRightAway
	override val KEY_KP_ADD_PRESSED: Boolean by keyMap[GLFW_KEY_KP_ADD]!!.delegatePressedRightAway
	override val KEY_KP_ENTER_PRESSED: Boolean by keyMap[GLFW_KEY_KP_ENTER]!!.delegatePressedRightAway
	override val KEY_KP_EQUAL_PRESSED: Boolean by keyMap[GLFW_KEY_KP_EQUAL]!!.delegatePressedRightAway
	override val KEY_LEFT_SHIFT_PRESSED: Boolean by keyMap[GLFW_KEY_LEFT_SHIFT]!!.delegatePressedRightAway
	override val KEY_LEFT_CONTROL_PRESSED: Boolean by keyMap[GLFW_KEY_LEFT_CONTROL]!!.delegatePressedRightAway
	override val KEY_LEFT_ALT_PRESSED: Boolean by keyMap[GLFW_KEY_LEFT_ALT]!!.delegatePressedRightAway
	override val KEY_LEFT_SUPER_PRESSED: Boolean by keyMap[GLFW_KEY_LEFT_SUPER]!!.delegatePressedRightAway
	override val KEY_RIGHT_SHIFT_PRESSED: Boolean by keyMap[GLFW_KEY_RIGHT_SHIFT]!!.delegatePressedRightAway
	override val KEY_RIGHT_CONTROL_PRESSED: Boolean by keyMap[GLFW_KEY_RIGHT_CONTROL]!!.delegatePressedRightAway
	override val KEY_RIGHT_ALT_PRESSED: Boolean by keyMap[GLFW_KEY_RIGHT_ALT]!!.delegatePressedRightAway
	override val KEY_RIGHT_SUPER_PRESSED: Boolean by keyMap[GLFW_KEY_RIGHT_SUPER]!!.delegatePressedRightAway
	override val KEY_MENU_PRESSED: Boolean by keyMap[GLFW_KEY_MENU]!!.delegatePressedRightAway
	override val KEY_LAST_PRESSED: Boolean by keyMap[GLFW_KEY_LAST]!!.delegatePressedRightAway

	override val KEY_SPACE_RELEASED: Boolean by keyMap[GLFW_KEY_SPACE]!!.delegateDepressedRightAway
	override val KEY_APOSTROPHE_RELEASED: Boolean by keyMap[GLFW_KEY_APOSTROPHE]!!.delegateDepressedRightAway
	override val KEY_COMMA_RELEASED: Boolean by keyMap[GLFW_KEY_COMMA]!!.delegateDepressedRightAway
	override val KEY_MINUS_RELEASED: Boolean by keyMap[GLFW_KEY_MINUS]!!.delegateDepressedRightAway
	override val KEY_PERIOD_RELEASED: Boolean by keyMap[GLFW_KEY_PERIOD]!!.delegateDepressedRightAway
	override val KEY_SLASH_RELEASED: Boolean by keyMap[GLFW_KEY_SLASH]!!.delegateDepressedRightAway
	override val KEY_0_RELEASED: Boolean by keyMap[GLFW_KEY_0]!!.delegateDepressedRightAway
	override val KEY_1_RELEASED: Boolean by keyMap[GLFW_KEY_1]!!.delegateDepressedRightAway
	override val KEY_2_RELEASED: Boolean by keyMap[GLFW_KEY_2]!!.delegateDepressedRightAway
	override val KEY_3_RELEASED: Boolean by keyMap[GLFW_KEY_3]!!.delegateDepressedRightAway
	override val KEY_4_RELEASED: Boolean by keyMap[GLFW_KEY_4]!!.delegateDepressedRightAway
	override val KEY_5_RELEASED: Boolean by keyMap[GLFW_KEY_5]!!.delegateDepressedRightAway
	override val KEY_6_RELEASED: Boolean by keyMap[GLFW_KEY_6]!!.delegateDepressedRightAway
	override val KEY_7_RELEASED: Boolean by keyMap[GLFW_KEY_7]!!.delegateDepressedRightAway
	override val KEY_8_RELEASED: Boolean by keyMap[GLFW_KEY_8]!!.delegateDepressedRightAway
	override val KEY_9_RELEASED: Boolean by keyMap[GLFW_KEY_9]!!.delegateDepressedRightAway
	override val KEY_SEMICOLON_RELEASED: Boolean by keyMap[GLFW_KEY_SEMICOLON]!!.delegateDepressedRightAway
	override val KEY_EQUAL_RELEASED: Boolean by keyMap[GLFW_KEY_EQUAL]!!.delegateDepressedRightAway
	override val KEY_A_RELEASED: Boolean by keyMap[GLFW_KEY_A]!!.delegateDepressedRightAway
	override val KEY_B_RELEASED: Boolean by keyMap[GLFW_KEY_B]!!.delegateDepressedRightAway
	override val KEY_C_RELEASED: Boolean by keyMap[GLFW_KEY_C]!!.delegateDepressedRightAway
	override val KEY_D_RELEASED: Boolean by keyMap[GLFW_KEY_D]!!.delegateDepressedRightAway
	override val KEY_E_RELEASED: Boolean by keyMap[GLFW_KEY_E]!!.delegateDepressedRightAway
	override val KEY_F_RELEASED: Boolean by keyMap[GLFW_KEY_F]!!.delegateDepressedRightAway
	override val KEY_G_RELEASED: Boolean by keyMap[GLFW_KEY_G]!!.delegateDepressedRightAway
	override val KEY_H_RELEASED: Boolean by keyMap[GLFW_KEY_H]!!.delegateDepressedRightAway
	override val KEY_I_RELEASED: Boolean by keyMap[GLFW_KEY_I]!!.delegateDepressedRightAway
	override val KEY_J_RELEASED: Boolean by keyMap[GLFW_KEY_J]!!.delegateDepressedRightAway
	override val KEY_K_RELEASED: Boolean by keyMap[GLFW_KEY_K]!!.delegateDepressedRightAway
	override val KEY_L_RELEASED: Boolean by keyMap[GLFW_KEY_L]!!.delegateDepressedRightAway
	override val KEY_M_RELEASED: Boolean by keyMap[GLFW_KEY_M]!!.delegateDepressedRightAway
	override val KEY_N_RELEASED: Boolean by keyMap[GLFW_KEY_N]!!.delegateDepressedRightAway
	override val KEY_O_RELEASED: Boolean by keyMap[GLFW_KEY_O]!!.delegateDepressedRightAway
	override val KEY_P_RELEASED: Boolean by keyMap[GLFW_KEY_P]!!.delegateDepressedRightAway
	override val KEY_Q_RELEASED: Boolean by keyMap[GLFW_KEY_Q]!!.delegateDepressedRightAway
	override val KEY_R_RELEASED: Boolean by keyMap[GLFW_KEY_R]!!.delegateDepressedRightAway
	override val KEY_S_RELEASED: Boolean by keyMap[GLFW_KEY_S]!!.delegateDepressedRightAway
	override val KEY_T_RELEASED: Boolean by keyMap[GLFW_KEY_T]!!.delegateDepressedRightAway
	override val KEY_U_RELEASED: Boolean by keyMap[GLFW_KEY_U]!!.delegateDepressedRightAway
	override val KEY_V_RELEASED: Boolean by keyMap[GLFW_KEY_V]!!.delegateDepressedRightAway
	override val KEY_W_RELEASED: Boolean by keyMap[GLFW_KEY_W]!!.delegateDepressedRightAway
	override val KEY_X_RELEASED: Boolean by keyMap[GLFW_KEY_X]!!.delegateDepressedRightAway
	override val KEY_Y_RELEASED: Boolean by keyMap[GLFW_KEY_Y]!!.delegateDepressedRightAway
	override val KEY_Z_RELEASED: Boolean by keyMap[GLFW_KEY_Z]!!.delegateDepressedRightAway
	override val KEY_LEFT_BRACKET_RELEASED: Boolean by keyMap[GLFW_KEY_LEFT_BRACKET]!!.delegateDepressedRightAway
	override val KEY_BACKSLASH_RELEASED: Boolean by keyMap[GLFW_KEY_BACKSLASH]!!.delegateDepressedRightAway
	override val KEY_RIGHT_BRACKET_RELEASED: Boolean by keyMap[GLFW_KEY_RIGHT_BRACKET]!!.delegateDepressedRightAway
	override val KEY_GRAVE_ACCENT_RELEASED: Boolean by keyMap[GLFW_KEY_GRAVE_ACCENT]!!.delegateDepressedRightAway
	override val KEY_WORLD_1_RELEASED: Boolean by keyMap[GLFW_KEY_WORLD_1]!!.delegateDepressedRightAway
	override val KEY_WORLD_2_RELEASED: Boolean by keyMap[GLFW_KEY_WORLD_2]!!.delegateDepressedRightAway
	override val KEY_ESCAPE_RELEASED: Boolean by keyMap[GLFW_KEY_ESCAPE]!!.delegateDepressedRightAway
	override val KEY_ENTER_RELEASED: Boolean by keyMap[GLFW_KEY_ENTER]!!.delegateDepressedRightAway
	override val KEY_TAB_RELEASED: Boolean by keyMap[GLFW_KEY_TAB]!!.delegateDepressedRightAway
	override val KEY_BACKSPACE_RELEASED: Boolean by keyMap[GLFW_KEY_BACKSPACE]!!.delegateDepressedRightAway
	override val KEY_INSERT_RELEASED: Boolean by keyMap[GLFW_KEY_INSERT]!!.delegateDepressedRightAway
	override val KEY_DELETE_RELEASED: Boolean by keyMap[GLFW_KEY_DELETE]!!.delegateDepressedRightAway
	override val KEY_RIGHT_RELEASED: Boolean by keyMap[GLFW_KEY_RIGHT]!!.delegateDepressedRightAway
	override val KEY_LEFT_RELEASED: Boolean by keyMap[GLFW_KEY_LEFT]!!.delegateDepressedRightAway
	override val KEY_DOWN_RELEASED: Boolean by keyMap[GLFW_KEY_DOWN]!!.delegateDepressedRightAway
	override val KEY_UP_RELEASED: Boolean by keyMap[GLFW_KEY_UP]!!.delegateDepressedRightAway
	override val KEY_PAGE_UP_RELEASED: Boolean by keyMap[GLFW_KEY_PAGE_UP]!!.delegateDepressedRightAway
	override val KEY_PAGE_DOWN_RELEASED: Boolean by keyMap[GLFW_KEY_PAGE_DOWN]!!.delegateDepressedRightAway
	override val KEY_HOME_RELEASED: Boolean by keyMap[GLFW_KEY_HOME]!!.delegateDepressedRightAway
	override val KEY_END_RELEASED: Boolean by keyMap[GLFW_KEY_END]!!.delegateDepressedRightAway
	override val KEY_CAPS_LOCK_RELEASED: Boolean by keyMap[GLFW_KEY_CAPS_LOCK]!!.delegateDepressedRightAway
	override val KEY_SCROLL_LOCK_RELEASED: Boolean by keyMap[GLFW_KEY_SCROLL_LOCK]!!.delegateDepressedRightAway
	override val KEY_NUM_LOCK_RELEASED: Boolean by keyMap[GLFW_KEY_NUM_LOCK]!!.delegateDepressedRightAway
	override val KEY_PRINT_SCREEN_RELEASED: Boolean by keyMap[GLFW_KEY_PRINT_SCREEN]!!.delegateDepressedRightAway
	override val KEY_PAUSE_RELEASED: Boolean by keyMap[GLFW_KEY_PAUSE]!!.delegateDepressedRightAway
	override val KEY_F1_RELEASED: Boolean by keyMap[GLFW_KEY_F1]!!.delegateDepressedRightAway
	override val KEY_F2_RELEASED: Boolean by keyMap[GLFW_KEY_F2]!!.delegateDepressedRightAway
	override val KEY_F3_RELEASED: Boolean by keyMap[GLFW_KEY_F3]!!.delegateDepressedRightAway
	override val KEY_F4_RELEASED: Boolean by keyMap[GLFW_KEY_F4]!!.delegateDepressedRightAway
	override val KEY_F5_RELEASED: Boolean by keyMap[GLFW_KEY_F5]!!.delegateDepressedRightAway
	override val KEY_F6_RELEASED: Boolean by keyMap[GLFW_KEY_F6]!!.delegateDepressedRightAway
	override val KEY_F7_RELEASED: Boolean by keyMap[GLFW_KEY_F7]!!.delegateDepressedRightAway
	override val KEY_F8_RELEASED: Boolean by keyMap[GLFW_KEY_F8]!!.delegateDepressedRightAway
	override val KEY_F9_RELEASED: Boolean by keyMap[GLFW_KEY_F9]!!.delegateDepressedRightAway
	override val KEY_F10_RELEASED: Boolean by keyMap[GLFW_KEY_F10]!!.delegateDepressedRightAway
	override val KEY_F11_RELEASED: Boolean by keyMap[GLFW_KEY_F11]!!.delegateDepressedRightAway
	override val KEY_F12_RELEASED: Boolean by keyMap[GLFW_KEY_F12]!!.delegateDepressedRightAway
	override val KEY_F13_RELEASED: Boolean by keyMap[GLFW_KEY_F13]!!.delegateDepressedRightAway
	override val KEY_F14_RELEASED: Boolean by keyMap[GLFW_KEY_F14]!!.delegateDepressedRightAway
	override val KEY_F15_RELEASED: Boolean by keyMap[GLFW_KEY_F15]!!.delegateDepressedRightAway
	override val KEY_F16_RELEASED: Boolean by keyMap[GLFW_KEY_F16]!!.delegateDepressedRightAway
	override val KEY_F17_RELEASED: Boolean by keyMap[GLFW_KEY_F17]!!.delegateDepressedRightAway
	override val KEY_F18_RELEASED: Boolean by keyMap[GLFW_KEY_F18]!!.delegateDepressedRightAway
	override val KEY_F19_RELEASED: Boolean by keyMap[GLFW_KEY_F19]!!.delegateDepressedRightAway
	override val KEY_F20_RELEASED: Boolean by keyMap[GLFW_KEY_F20]!!.delegateDepressedRightAway
	override val KEY_F21_RELEASED: Boolean by keyMap[GLFW_KEY_F21]!!.delegateDepressedRightAway
	override val KEY_F22_RELEASED: Boolean by keyMap[GLFW_KEY_F22]!!.delegateDepressedRightAway
	override val KEY_F23_RELEASED: Boolean by keyMap[GLFW_KEY_F23]!!.delegateDepressedRightAway
	override val KEY_F24_RELEASED: Boolean by keyMap[GLFW_KEY_F24]!!.delegateDepressedRightAway
	override val KEY_F25_RELEASED: Boolean by keyMap[GLFW_KEY_F25]!!.delegateDepressedRightAway
	override val KEY_KP_0_RELEASED: Boolean by keyMap[GLFW_KEY_KP_0]!!.delegateDepressedRightAway
	override val KEY_KP_1_RELEASED: Boolean by keyMap[GLFW_KEY_KP_1]!!.delegateDepressedRightAway
	override val KEY_KP_2_RELEASED: Boolean by keyMap[GLFW_KEY_KP_2]!!.delegateDepressedRightAway
	override val KEY_KP_3_RELEASED: Boolean by keyMap[GLFW_KEY_KP_3]!!.delegateDepressedRightAway
	override val KEY_KP_4_RELEASED: Boolean by keyMap[GLFW_KEY_KP_4]!!.delegateDepressedRightAway
	override val KEY_KP_5_RELEASED: Boolean by keyMap[GLFW_KEY_KP_5]!!.delegateDepressedRightAway
	override val KEY_KP_6_RELEASED: Boolean by keyMap[GLFW_KEY_KP_6]!!.delegateDepressedRightAway
	override val KEY_KP_7_RELEASED: Boolean by keyMap[GLFW_KEY_KP_7]!!.delegateDepressedRightAway
	override val KEY_KP_8_RELEASED: Boolean by keyMap[GLFW_KEY_KP_8]!!.delegateDepressedRightAway
	override val KEY_KP_9_RELEASED: Boolean by keyMap[GLFW_KEY_KP_9]!!.delegateDepressedRightAway
	override val KEY_KP_DECIMAL_RELEASED: Boolean by keyMap[GLFW_KEY_KP_DECIMAL]!!.delegateDepressedRightAway
	override val KEY_KP_DIVIDE_RELEASED: Boolean by keyMap[GLFW_KEY_KP_DIVIDE]!!.delegateDepressedRightAway
	override val KEY_KP_MULTIPLY_RELEASED: Boolean by keyMap[GLFW_KEY_KP_MULTIPLY]!!.delegateDepressedRightAway
	override val KEY_KP_SUBTRACT_RELEASED: Boolean by keyMap[GLFW_KEY_KP_SUBTRACT]!!.delegateDepressedRightAway
	override val KEY_KP_ADD_RELEASED: Boolean by keyMap[GLFW_KEY_KP_ADD]!!.delegateDepressedRightAway
	override val KEY_KP_ENTER_RELEASED: Boolean by keyMap[GLFW_KEY_KP_ENTER]!!.delegateDepressedRightAway
	override val KEY_KP_EQUAL_RELEASED: Boolean by keyMap[GLFW_KEY_KP_EQUAL]!!.delegateDepressedRightAway
	override val KEY_LEFT_SHIFT_RELEASED: Boolean by keyMap[GLFW_KEY_LEFT_SHIFT]!!.delegateDepressedRightAway
	override val KEY_LEFT_CONTROL_RELEASED: Boolean by keyMap[GLFW_KEY_LEFT_CONTROL]!!.delegateDepressedRightAway
	override val KEY_LEFT_ALT_RELEASED: Boolean by keyMap[GLFW_KEY_LEFT_ALT]!!.delegateDepressedRightAway
	override val KEY_LEFT_SUPER_RELEASED: Boolean by keyMap[GLFW_KEY_LEFT_SUPER]!!.delegateDepressedRightAway
	override val KEY_RIGHT_SHIFT_RELEASED: Boolean by keyMap[GLFW_KEY_RIGHT_SHIFT]!!.delegateDepressedRightAway
	override val KEY_RIGHT_CONTROL_RELEASED: Boolean by keyMap[GLFW_KEY_RIGHT_CONTROL]!!.delegateDepressedRightAway
	override val KEY_RIGHT_ALT_RELEASED: Boolean by keyMap[GLFW_KEY_RIGHT_ALT]!!.delegateDepressedRightAway
	override val KEY_RIGHT_SUPER_RELEASED: Boolean by keyMap[GLFW_KEY_RIGHT_SUPER]!!.delegateDepressedRightAway
	override val KEY_MENU_RELEASED: Boolean by keyMap[GLFW_KEY_MENU]!!.delegateDepressedRightAway
	override val KEY_LAST_RELEASED: Boolean by keyMap[GLFW_KEY_LAST]!!.delegateDepressedRightAway


	override val MOUSE_BUTTON_1_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_1]!!.delegatePressedRightAway
	override val MOUSE_BUTTON_2_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_2]!!.delegatePressedRightAway
	override val MOUSE_BUTTON_3_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_3]!!.delegatePressedRightAway
	override val MOUSE_BUTTON_4_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_4]!!.delegatePressedRightAway
	override val MOUSE_BUTTON_5_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_5]!!.delegatePressedRightAway
	override val MOUSE_BUTTON_6_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_6]!!.delegatePressedRightAway
	override val MOUSE_BUTTON_7_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_7]!!.delegatePressedRightAway
	override val MOUSE_BUTTON_8_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_8]!!.delegatePressedRightAway

	override val MOUSE_BUTTON_1_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_1]!!.delegateDepressedRightAway
	override val MOUSE_BUTTON_2_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_2]!!.delegateDepressedRightAway
	override val MOUSE_BUTTON_3_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_3]!!.delegateDepressedRightAway
	override val MOUSE_BUTTON_4_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_4]!!.delegateDepressedRightAway
	override val MOUSE_BUTTON_5_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_5]!!.delegateDepressedRightAway
	override val MOUSE_BUTTON_6_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_6]!!.delegateDepressedRightAway
	override val MOUSE_BUTTON_7_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_7]!!.delegateDepressedRightAway
	override val MOUSE_BUTTON_8_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_8]!!.delegateDepressedRightAway

	fun makeSnapshot(): UserInputSnapshot {
		return UserInputSnapshot(this)
	}

	fun makeMutableSnapshot(): MutableUserInputSnapshot {
		return MutableUserInputSnapshot(this)
	}

	companion object {
		private val LOGGER = LogManager.getLogger(UserInput::class.java)
	}
}
