package me.vrekt.lunar.input;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public class InputListener implements KeyListener {

	private static boolean keyData[] = new boolean[256];

	/**
	 * Return if the key is down.
	 */
	public static boolean isKeyDown(int key) {
		return keyData[key];
	}

	@Override
	public void keyPressed(KeyEvent event) {
		keyData[event.getKeyCode()] = true;
	}

	@Override
	public void keyReleased(KeyEvent event) {
		keyData[event.getKeyCode()] = false;
	}

	@Override
	public void keyTyped(KeyEvent event) {
	}
}

@@ -209,16 +209,69 @@
 56%5D;%0D%0A%0D%0A
+%09private static Long keyStart%5B%5D = new Long%5B256%5D;%0D%0A%09%0D%0A
 %09/**%0D%0A%09 
@@ -374,24 +374,383 @@
 a%5Bkey%5D;%0D%0A%09%7D%0D
+%0A%09%0D%0A%09/*%0D%0A%09* Returns the amount of time the key has been depressed.%0D%0A%09* @return The amount of time the key has been depressed, in milliseconds.%0D%0A%09*/%0D%0A%09public static long keyDownDuration(int key) %7B%0D%0A%09    Long start = keyStart%5Bkey%5D;%0D%0A%09    if (keyStart%5Bkey%5D != null) %7B%0D%0A%09%09 return System.currentTimeMillis() - start;%0D%0A%09    %7D%0D%0A%09    else %7B%0D%0A%09%09 return 0;%0D%0A%09    %7D%0D%0A%09%7D%0D
 %0A%0D%0A%09@Overrid
@@ -830,24 +830,86 @@
 )%5D = true;%0D%0A
+%09%09keyStart%5Bevent.getKeyCode()%5D = System.currentTimeMillis();%0D%0A
 %09%7D%0D%0A%0D%0A%09@Over
@@ -998,16 +998,56 @@
 false;%0D%0A
+%09%09keyStart%5Bevent.getKeyCode()%5D = null;%0D%0A
 %09%7D%0D%0A%0D%0A%09@

Add keyDownDuration to InputListener