public static void initialize(Component canvas) {
		keys = new boolean[402];
		
		// MAKE KEY EVENT LISTENER
		
		KeyAdapter keyAdapter = new KeyAdapter() {

			@Override
			public void keyPressed(KeyEvent e)
			{
				//System.out.println("Key code: " + e.getKeyCode());
				if (keys[e.getKeyCode()] || e.getKeyCode() >= 402) return;
				
				KeyListener kl;
				for (int i = keyListeners.size() - 1; i >= 0; i --) {
					kl = keyListeners.get(i);
					kl.keyDown(e);
				}
				
				
				keys[e.getKeyCode()] = true;
			}
			@Override
			public void keyReleased(KeyEvent e)
			{
				if (!keys[e.getKeyCode()] || e.getKeyCode() >= 402) return;
				
				KeyListener kl;
				for (int i = keyListeners.size() - 1; i >= 0; i --) {
					kl = keyListeners.get(i);
					kl.keyUp(e);
				}
				keys[e.getKeyCode()] = false;
			}
		};
		
		// MAKE MOUSE EVENT LISTENER.

		MouseInput mouseAdapter = new MouseInput();
		
		//
		
		canvas.addKeyListener(keyAdapter);
		canvas.addMouseListener(mouseAdapter);
		canvas.addMouseMotionListener(mouseAdapter);
	}