Skip to content
ExamplesOpen editor ↗

taetsiNngweETshwerwe

→ keyIsPressed

Is `nnete` while **any** key at all is held down, and `maaka` when none is.

taetsiNngweETshwerwe

It does not tell you which key — only that some key is down. To ask about a particular one, use taetsiETshwerwe and hand it the key you mean.

nngwe in the name is the ordinary Setswana for some, any one — it is what marks this as a question about any key rather than a named one. That is why the name is longer than its twin konopoETshwerwe: a mouse has a few buttons, a keyboard has a hundred keys.

Click the sketch first so the keyboard reaches it.

A background that changes while a key is down
tiro setaLoeto() {
  thalaKanefase(400, 220);
  tlhalosa('Kanefase e e fetolang bokamorago fa taetsi nngwe e ntse e tshwerwe. Tobetsa setshwantsho pele.');
}

tiro tshwantsha() {
  fa (taetsiNngweETshwerwe) {
    bokamorago(70, 150, 120);
  } gongwe {
    bokamorago(238);
  }

  tlogelaMothalo();
  tlatsaMmala(40);
  bogoloJwaMokwalo(17);
  rulaganyaMokwalo(BOGARE);
  thalaMokwalo('Tshwara taetsi nngwe le nngwe', 200, 115);
}

taetsiETshwerwe, konopoETshwerwe, taetsiETobeditswe