package me.shzylo.mansionazazelvisual.input;

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

public class Keyboard implements KeyListener {

  private boolean[] keys = new boolean[120];
	public boolean up, down, left, right, debug;

	public void update() {
		up = keys[KeyEvent.VK_UP] || keys[KeyEvent.VK_W];
		down = keys[KeyEvent.VK_DOWN] || keys[KeyEvent.VK_S];
		left = keys[KeyEvent.VK_LEFT] || keys[KeyEvent.VK_A];
		right = keys[KeyEvent.VK_RIGHT] || keys[KeyEvent.VK_D];

		debug = keys[KeyEvent.VK_F1];
	}

	public void keyPressed(KeyEvent e) {
		if (e.getKeyCode() == 112) { // 112 = F1
			if (!debug) {
				keys[e.getKeyCode()] = true;
			} else {
				keys[e.getKeyCode()] = false;
			}
		} else {
			if (e.getKeyCode() < keys.length) {
				keys[e.getKeyCode()] = true;
			}
		}
	}

	public void keyReleased(KeyEvent e) {
		if ((!(e.getKeyCode() == 112)) && e.getKeyCode() < keys.length) {
			keys[e.getKeyCode()] = false;
		}
	}

	public void keyTyped(KeyEvent e) {
		keys[e.getKeyCode()] = true;
	}
}

@@ -28,14 +28,8 @@
 azel
-visual
 .inp
@@ -101,16 +101,63 @@
 tener;%0A%0A
+/**%0A * The user's input for the character.%0A */%0A
 public c
@@ -199,18 +199,15 @@
 r %7B%0A
-%0A  private
+%09public
  boo
@@ -285,16 +285,46 @@
 debug;%0A%0A
+%09/**%0A%09 * Update the keys%0A%09 */%0A
 %09public 
@@ -393,20 +393,20 @@
 K_W%5D;%0A%09%09
-down
+left
  = keys%5B
@@ -421,12 +421,12 @@
 .VK_
-DOWN
+LEFT
 %5D %7C%7C
@@ -447,18 +447,18 @@
 .VK_
-S
+A
 %5D;%0A%09%09
-left
+down
  = k
@@ -465,36 +465,36 @@
 eys%5BKeyEvent.VK_
-LEFT
+DOWN
 %5D %7C%7C keys%5BKeyEve
@@ -495,25 +495,25 @@
 KeyEvent.VK_
-A
+S
 %5D;%0A%09%09right =
@@ -561,16 +561,18 @@
 .VK_D%5D;%0A
+%09%09
 %0A%09%09debug
@@ -672,20 +672,8 @@
 2) %7B
- // 112 = F1
 %0A%09%09%09
@@ -683,18 +683,16 @@
 (!debug)
- %7B
 %0A%09%09%09%09key
@@ -720,24 +720,20 @@
 rue;%0A%09%09%09
-%7D 
 else
- %7B
 %0A%09%09%09%09key
@@ -759,21 +759,16 @@
  false;%0A
-%09%09%09%7D%0A
 %09%09%7D else
@@ -1073,10 +1073,11 @@
 rue;%0A%09%7D%0A
+%0A
 %7D%0A

Update Keyboard.java