Difference between revisions of "Legacy:IsAnyKeyPressed"

From Spherical
Jump to: navigation, search
(created from http://web.archive.org/web/20110803044948/http://www.spheredev.org/wiki/IsAnyKeyPressed)
 
(No difference)

Latest revision as of 22:01, 1 June 2013

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