@@ -0,0 +1,1597 @@
+package jelly;%0A%0Aimport java.awt.event.KeyEvent;%0Aimport java.awt.event.KeyListener;%0Aimport java.util.HashMap;%0A%0A/**%0A * Essentially a keyboard manipulation/input handler%0A * To use add a key listener to the window with an%0A * instance of this class e.g.%0A * %3Ccode%3Ejframe.addKeyListener(new KeyInput());%3C/code%3E%0A * @author Almas%0A * @version 1.0%0A */%0Apublic class KeyInput implements KeyListener%0A%7B%0A  public enum GameEvent%0A%09%7B%0A%09%09NONE,%0A%09%09PLAYER_MOVE_LEFT,%0A%09%09PLAYER_MOVE_RIGHT,%0A%09%09PLAYER_JUMP%0A%09%7D%0A%09%0A%09private GameEvent event = GameEvent.NONE;%0A%09private HashMap%3CGameEvent, Boolean%3E events = new HashMap%3CGameEvent, Boolean%3E();%0A%09%0A%09@Override%0A%09public void keyPressed(KeyEvent e)%0A%09%7B%0A%09%09switch (e.getKeyCode())%0A%09%09%7B%09%09%0A%09%09%09case KeyEvent.VK_LEFT:%0A%09%09%09%09event = GameEvent.PLAYER_MOVE_LEFT;%0A%09%09%09%09break;%0A%09%09%09%09%0A%09%09%09case KeyEvent.VK_RIGHT:%0A%09%09%09%09event = GameEvent.PLAYER_MOVE_RIGHT;%0A%09%09%09%09break;%0A%09%09%09%09%0A%09%09%09case KeyEvent.VK_SPACE: case KeyEvent.VK_UP:%0A%09%09%09%09event = GameEvent.PLAYER_JUMP;%0A%09%09%09%09break;%0A%09%09%09%09%0A%09%09%09default:%0A%09%09%09%09return;%0A%09%09%7D%0A%09%09%0A%09%09events.put(event, true);%0A%09%7D%0A%0A%09@Override%0A%09public void keyReleased(KeyEvent e)%0A%09%7B%0A%09%09switch (e.getKeyCode())%0A%09%09%7B%09%09%0A%09%09%09case KeyEvent.VK_LEFT:%0A%09%09%09%09event = GameEvent.PLAYER_MOVE_LEFT;%0A%09%09%09%09break;%0A%09%09%09%09%0A%09%09%09case KeyEvent.VK_RIGHT:%0A%09%09%09%09event = GameEvent.PLAYER_MOVE_RIGHT;%0A%09%09%09%09break;%0A%09%09%09%09%0A%09%09%09case KeyEvent.VK_SPACE: case KeyEvent.VK_UP:%0A%09%09%09%09event = GameEvent.PLAYER_JUMP;%0A%09%09%09%09break;%0A%09%09%09%09%0A%09%09%09default:%0A%09%09%09%09return;%0A%09%09%7D%0A%09%09%0A%09%09events.put(event, false);%0A%09%7D%0A%0A%09@Override%0A%09public void keyTyped(KeyEvent e) %7B%7D%0A%09%0A%09/**%0A%09 * @return - the current event map%0A%09 */%0A%09public HashMap%3CGameEvent, Boolean%3E getEvents() %7B%0A%09%09return events;%0A%09%7D%0A%7D%0A

Create KeyInput.java