Determines whether a key or mouse button is up or down at the time the function is called.

bool Input_GetKeyState(
  int key


Specifies one of virtual-key codes. For more information see Key codes section.

Return value

If the key is currently pressed down, returns true. Otherwise returns false.


Input_GetKeyState handles keyboard keys and mouse buttons.

The key states are updated outside user's frame function. So don't use Input_GetKeyState in a loop to wait a key to be pressed or released, this will result in system hang up.


Header: hge.h
Import library: hge.lib

See also

Input_GetKeyName, Input_GetKey, Input_GetChar, Key codes