Why is it not displaying my typed keys?

i would like text to show up in the rectangle that appears when kill is true, but it’s not working. why?

PImage shop;
PImage settings;
PImage teams;
PImage kill;
PImage phone;
PImage coin;
PImage bounty;

boolean invert = false;

boolean main = true;
boolean shopb = false;
boolean settingsb = false;
boolean teamsb = false;
boolean killb = false;
boolean balanceb = false;
boolean bountyb = false;

String weapon = "pistol";

String typed = "";

void setup() {

	size(278, 599);

	if (invert) {
		filter(INVERT);
	}

	shop = loadImage("cart.png");
	settings = loadImage("settings.png");
	teams = loadImage("teams.png");
	kill = loadImage("kill.png");
	coin = loadImage("coin.png");
	bounty = loadImage("bounty.png");

	phone = loadImage("android.png");
}

void draw() {
	background(255);
	fill(125);

	if (killb) {

		rect(width / 2 - 150, height / 2, 300, 30);
		fill(255);
		text(typed + key + "L", width / 2 - 150, height / 2, 300, 30);
		fill(125);
	}


	if (main) {
		textSize(13);
		text("active weapon: " + weapon, width / 2 - 60, 13);
		line(width / 2, 0, width / 2, height);
		line(0, (599.05511811 / 4) * 2, width, (599.05511811 / 4) * 2);
		line(0, (599.05511811 / 4) * 3, width, (599.05511811 / 4) * 3);

		image(teams, -40, -70, 278.17322835 / 2 + 80, (599.05511811 / 4) * 2 + 130);


		image(shop, width / 2, 30, 278.17322835 / 2, (599.05511811 / 4) * 2 - 90);


		image(settings, 5, (599.05511811 / 4) * 2, 278.17322835 / 2 - 15, (599.05511811 / 4) * 2 - 180);


		image(kill, width / 2 + 10, (599.05511811 / 4) * 2, 278.17322835 / 2 - 15, (599.05511811 / 4) * 2 - 180);


		image(coin, 10, (599.05511811 / 4) * 3 + 10, 278.17322835 / 2 - 20, (599.05511811 / 4) * 2 - 190);


		image(bounty, width / 2, (599.05511811 / 4) * 3 + 10, 278.17322835 / 2, (599.05511811 / 4) * 2 - 190);

		textSize(40);
		text("shop", width / 2 + 40, (599.05511811 / 4) * 2 - 20, 50);
		text("teams", 20, (599.05511811 / 4) * 2 - 20, 50);
		text("settings", 0, (599.05511811 / 4) * 2 + 100, 278.17322835 / 2, (599.05511811 / 4) * 2 - 150);
		text("kill", width / 2 + 45, (599.05511811 / 4) * 2 + 100, 278.17322835 / 2 - 15, (599.05511811 / 4) * 2 - 180);
		text("balance", 0, (599.05511811 / 4) * 2 + 255, 278.17322835 / 2, (599.05511811 / 4) * 2 + 300);
		text("bounty", width / 2 + 10, (599.05511811 / 4) * 3 + 105, 278.17322835 / 2, (599.05511811 / 4) * 2 - 190);
	}
}




void mouseClicked() {
	if (mouseX >= 0 && mouseX <= width / 2 && mouseY >= 0 && mouseY <= (599.05511811 / 4) * 2) {
		teamsb = true;
		main = false;
	}

	if (mouseX >= width / 2 && mouseX <= width && mouseY >= 0 && mouseY <= (599.05511811 / 4) * 2) {
		shopb = true;
		main = false;
	}

	if (mouseX >= 0 && mouseX <= width / 2 && mouseY >= (599.05511811 / 4) * 2 && mouseY <= (599.05511811 / 4) * 3) {
		settingsb = true;
		main = false;
	}

	if (mouseX >= width / 2 && mouseX <= width && mouseY >= (599.05511811 / 4) * 2 && mouseY <= (599.05511811 / 4) * 3) {
		killb = true;
		main = false;
	}

	if (mouseX >= 0 && mouseX <= width / 2 && mouseY >= (599.05511811 / 4) * 3 && mouseY <= height) {
		balanceb = true;
		main = false;
	}

	if (mouseX >= width / 2 && mouseX <= width && mouseY >= (599.05511811 / 4) * 3 && mouseY <= height) {
		bountyb = true;
		main = false;
	}

}