Since engine version: 1.0 OC (extended in 8.0 OC)
Returns the current state of a control for a certain player. If the control is assigned to a key, a value not equal to 0 means that the key is currently held down by the player. For analog controls on gamepads, the function either queries the current emulated button state (analog_strength = false), or the current position of the stick or trigger (analog_strength = true).
int GetPlayerControlState(int player, int control, bool analog_strength);
- Number of the player whose control state you want to query.
- Control to query. A CON_* constant should be used here.
- [opt] If true: Query current state of an analog control on a gamepad instead of the emulated button state.
if (GetPlayerControlState(GetOwner(), CON_Left) != 0) Log("You are currently holding down the left cursor key!");
Prints a message when the player is holding down the key assigned to the control CON_Left.
See also: GetPlayerControlAssignment