Skip to content
ExamplesOpen editor ↗

taetsi

→ key

A string naming the key that was pressed most recently.

taetsi

When the reader presses a, taetsi is 'a'. Holding SHIFT and pressing a gives 'A'.

fa (taetsi === 'a') { ... }

taetsi also reports keys that type nothing: the left arrow key gives 'ArrowLeft', and ENTER gives 'Enter'. Measured.

Even so, taetsiETshwerwe is the right tool for arrow keys: it works when two keys are held at once, where taetsi only ever holds one — the most recent.

taetsi, not konopo. Setswana keeps the two apart: a taetsi belongs to the keyboard, a konopo to the mouse. Bopa follows that split, and it is what leaves konopo free for the mouse in konopoYaPeba.

Click the sketch first so that key presses reach it.

Show the key that was just pressed
diri e = '?';

tiro setaLoeto() {
  thalaKanefase(400, 220);
  tlhalosa('Tlhaka e kgolo mo bogareng jwa kanefase e e bontshang taetsi e e sa tswang go tobediwa. Tobetsa setshwantsho pele.');
}

tiro tshwantsha() {
  bokamorago(30, 34, 44);
  tlatsaMmala(245, 220, 140);
  bogoloJwaMokwalo(72);
  rulaganyaMokwalo(BOGARE);
  thalaMokwalo(e, 200, 135);
}

tiro taetsiETobeditswe() {
  e = taetsi;
}

khoutuYaTaetsi, taetsiETshwerwe, taetsiETobeditswe, taetsiEKwadilwe