Legacy:GetKey

From Spherical
(Redirected from GetKey)
Jump to: navigation, search


Returns one instance of a KEY_* constant in the internal key queue.

Usage

bool GetKey();


Notes

Best used with AreKeysLeft() since this can block all execution until a key has been encountered.

Examples

Blocking execution from continuing. It'll count each time you hit a random key.

var font = GetSystemFont();

for (var i = 0; i < 10; ++i) {
    font.drawText(0, 0, i);
    FlipScreen();
    GetKey();
}

It can also be used to clear the key buffer.

while (AreKeysLeft()) GetKey();


See also