Legacy:IsAnyKeyPressed

From Spherical
Revision as of 22:01, 1 June 2013 by Apollolux (talk | contribs) (created from http://web.archive.org/web/20110803044948/http://www.spheredev.org/wiki/IsAnyKeyPressed)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Checks if any key was pressed (eg. if there were keys in the key queue). Returns true if so, and else false.

Usage

boolean IsAnyKeyPressed();


Examples

if (IsAnyKeyPressed())
{
  Abort("A key was pressed or left in the key queue!");
}

Checks if any key was pressed. If true, aborts with the message a key was pressed.

Notes

  • IsAnyKeyPressed() can not receive which key was pressed! Use IsKeyPressed() or GetKey() for that.
  • The function does not halt the program like GetKey() does and thus can be used in loops without interruption.

See also