public boolean click(Level level, Sprite sprite, int x, int y, int button) 
    {
    	if (level.player.carried == null)
    	{
    		level.player.addString("A key is required to use this lock");
    		return true;
    	}
    	if (!(level.player.carried instanceof ItemKey))
    	{
    		level.player.addString("A key is required to use this lock");
    		return true;
    	}
    	if (pressed)
    	{
    		level.player.addString("This lock has already been opened");
    		return true;
    	}
    	if (level.player.carried instanceof ItemKey)
    	{
    		if (level.player.carried != key)
    		{
	    		level.player.addString("The key doesn't turn...");
	    		return true;
    		}
    		else
    		{
    	        pressed = !pressed;
    	        level.trigger(switchID, pressed);
    	        level.player.carried = null;
    		}
    	}

        return true;
    }