HGE::Input_GetKeyState

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

bool Input_GetKeyState(
  int key
);

Parameters

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.

Remarks

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.

Requirements

Header: hge.h
Import library: hge.lib

See also

Input_GetKeyName, Input_GetKey, Input_GetChar, Key codes