package com.ralitski.util.input;

import org.lwjgl.Sys;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;

public class LWJGLInputFeed implements InputFeed {

	@Override
	public boolean mouseNext() {
		return Mouse.next();
	}

	@Override
	public int getMouseButtonCount() {
		return Mouse.getButtonCount();
	}

	@Override
	public boolean isMouseButtonDown(int btn) {
		return Mouse.isButtonDown(btn);
	}

	@Override
	public int getMouseX() {
		return Mouse.getX();
	}

	@Override
	public int getMouseY() {
		return Mouse.getY();
	}

	@Override
	public boolean isMouseInsideWindow() {
		return Mouse.isInsideWindow();
	}

	@Override
	public int getMouseEventButton() {
		return Mouse.getEventButton();
	}

	@Override
	public boolean getMouseEventButtonState() {
		return Mouse.getEventButtonState();
	}

	@Override
	public int getMouseEventX() {
		return Mouse.getEventX();
	}

	@Override
	public int getMouseEventY() {
		return Mouse.getEventY();
	}

	@Override
	public int getMouseEventDWheel() {
		return Mouse.getEventDWheel();
	}

	@Override
	public int getMouseEventDX() {
		return Mouse.getEventDX();
	}

	@Override
	public int getMouseEventDY() {
		return Mouse.getEventDY();
	}

	@Override
	public long getMouseEventTime() {
		return Mouse.getEventNanoseconds();
	}

	@Override
	public boolean keyNext() {
		return Keyboard.next();
	}

	@Override
	public boolean isKeyDown(int key) {
		return Keyboard.isKeyDown(key);
	}

	@Override
	public int getKeyEventKey() {
		return Keyboard.getEventKey();
	}

	@Override
	public char getKeyEventCharacter() {
		return Keyboard.getEventCharacter();
	}

	@Override
	public boolean getKeyEventState() {
		return Keyboard.getEventKeyState();
	}

	@Override
	public long getKeyEventTime() {
		return Keyboard.getEventNanoseconds();
	}

	//multiply by 1E9 to get nano instead of seconds
	@Override
	public long getTime() {
		return (Sys.getTime() * 1000000000) / Sys.getTimerResolution();
	}

}

@@ -163,16 +163,270 @@
 utFeed %7B
+%0A%09%0A%09private static LWJGLInputFeed feed;%0A%09%0A%09//only allow one call to prevent input concurrent reading of input buffer%0A%09public static LWJGLInputFeed getFeed() %7B%0A%09%09return feed == null ? (feed = new LWJGLInputFeed()) : null;%0A%09%7D%0A%09%0A%09private LWJGLInputFeed() %7B%7D
 %0A%0A%09@Over

Update LWJGLInputFeed.java