Input functions

ACSUtils provides a set of wrappers for GetPlayerInput to make writing correct input code easier.

Basic concepts

Every key can be either up or down.

If the key was up the previous tic, but is now down, it is said to have been pressed.

If the key was down the previous tic, but is now up, it is said to have been released.

If the key has been pressed or released, it is said to have been toggled.

ACSUtils provide a way to easily check these all these states for every key without writing compliated GetPlayerInput expressions.

Functions

To check one key or a key combination:

bool KeyUp(int key)

bool KeyDown(int key)

bool KeyPressed(int key)

bool KeyReleased(int key)

bool KeyToggled(int key)

Examples:

Checking one key:

if (KeyPressed(BT_FORWARD))
print(s:"You just pressed W");

Checking a key combination:

if (KeyDown(BT_FORWARD | BT_BACK))
print(s:"You are trying to move forward and back at the same time. You are not going anywhere this way.");