public ActionListener mouseListener()
	{
		return new ActionListener()
		{
			@Override
			public void onAction(String name, boolean isPressed, float tpf)
			{
				if (isPressed)
				if (name.equals(MAP_SELECT))
	    		{
	    			CollisionResults results = new CollisionResults();
	    			Vector2f click2d = inputManager.getCursorPosition();
	    			Vector3f click3d = cam.getWorldCoordinates(click2d, 0f); // depth 0
	    			// 1 WU deep into the screen
	    			Vector3f dir = cam.getWorldCoordinates(click2d, 0.5f).subtractLocal(click3d);
	    			Ray ray  = new Ray(click3d, dir);
	    			
	    			rootNode.collideWith(ray, results);
	    			for (CollisionResult res : results)
					{
	    				Geometry hit = res.getGeometry();
	    				String hitName = hit.getName();
	    				// If it's the board
	    				if (hitName.charAt(0) == '@')
	    				{
	    					// If a piece is selected, move the piece to the designated location 
	    					// and detach the SelectionControl
	    					if (selectedPiece != null)
	    					{
	    						selectedPiece.addControl(
	    									boardManager.moveControl(hitName));
	    						stateManager.detach(quadHighlightState);
	    						selectedPiece = null;
	    					}
    	    				break;
	    				}
	    				else if (hitName.charAt(0) == '*') // hits a piece
	    				{
	    					Piece hitPiece = (Piece) hit;
	    					if (hitPiece != selectedPiece)
	    					{
    	    					selectedPiece = hitPiece;
        						selectedPiece.addControl(new PieceSelectedControl());
        						// If a piece is selected, we allow quad highlighting
        						stateManager.attach(quadHighlightState);
	    					}
    	    				break;
	    				}
					}
	    		}
				// Right click
				else if (name.equals(MAP_DESELECT))
				{
					selectedPiece = null;
					stateManager.detach(quadHighlightState);
				}
					
			}
		};
	}