Skip to content
ExamplesOpen editor ↗

konopoYaPeba

→ mouseButton

An object that tells you which mouse buttons are down right now.

konopoYaPeba.left

konopoYaPeba is not a number and not a boolean — it is an object with three fields, each nnete or maaka:

  • konopoYaPeba.left — the left button
  • konopoYaPeba.right — the right button
  • konopoYaPeba.center — the middle button (the wheel)

So you read it like this:

fa (konopoYaPeba.left) { ... }

The field names stay English (left, right, center) because they are the object’s own property names, not Bopa keywords.

Careful: fa (konopoYaPeba) is ALWAYS true. It is an object, and every object counts as true — so that branch is taken even when no button is down at all. Read one of its fields (konopoYaPeba.left), or use konopoETshwerwe, which really is a boolean.

If you only want to know whether any button is down, you do not need konopoYaPeba at all — use konopoETshwerwe, which is a plain boolean.

A colour for each button
tiro setaLoeto() {
  thalaKanefase(400, 240);
  tlhalosa('Sediko se se mo bogareng se se fetolang mmala go ya ka konopo ya peba e e tshwerweng.');
}

tiro tshwantsha() {
  bokamorago(238);
  tlogelaMothalo();

  fa (konopoYaPeba.left) {
    tlatsaMmala(220, 90, 80);
  } gongwe {
    fa (konopoYaPeba.right) {
      tlatsaMmala(80, 160, 110);
    } gongwe {
      tlatsaMmala(180, 185, 195);
    }
  }

  thalaSediko(200, 120, 130);
}

konopoETshwerwe, pebaETobeditswe, pebaX, pebaY