public void keyPressed(KeyEvent e) {
	SpellsModel m = (SpellsModel) model;
	JList spellList = m.getSpellList();
	Player player = (Player) m.getPlayer();
	
	GameModel gameModel = ((GameModel) Jorma.MODEL_GAME);
	switch (e.getKeyCode()) {
	case KeyEvent.VK_ESCAPE:
	    m.getWindow().getJorma().setCurrentModel(gameModel);
	    break;
	case KeyEvent.VK_UP:
	    spellList.previousPage();
	    break;
	case KeyEvent.VK_DOWN:
	    spellList.nextPage();
	    break;
	default:
	    for (JListObject o : spellList.getVisibleObjects()) {
		if (o.getLetter() == e.getKeyChar()) {
		    Spell s = (Spell) o.getObject();

		    if (player.getMp() >= s.getCost()) {
			m.getWindow().getJorma().setCurrentModel(gameModel);
			gameModel.clearOutput();
			if (s.isDirected()) {
			    gameModel.addMessage("Give direction.");
			    gameModel.setSpellBeingCasted(s);
			} else {
			    s.cast(null);
			}
		    }
		    break;
		}
	    }
	}
    }