taetsi
→ keyA string naming the key that was pressed most recently.
taetsiWhen 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, notkonopo. Setswana keeps the two apart: ataetsibelongs to the keyboard, akonopoto the mouse. Bopa follows that split, and it is what leaveskonopofree for the mouse inkonopoYaPeba.
Click the sketch first so that key presses reach it.
Examples
Section titled “Examples”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;
}See also
Section titled “See also”khoutuYaTaetsi, taetsiETshwerwe, taetsiETobeditswe, taetsiEKwadilwe