PlayerControl

Category: Callbacks
Since engine version: 1.0 OC

Description

Called globally for each control command by players. See Player Controls.

Syntax

bool PlayerControl(int player, int control, id control_extra, int x, int y, int strength, bool repeated, int state);

Parameters

player:
Number of the player who pressed the control.
control:
Number of the pressed control, defined as a CON_ constant via PlayerControls.txt.
control_extra:
Optional id defined with ExtraData in PlayerControls.txt.
x:
X coordinate for mouse controls.
y:
Y coordinate for mouse controls.
strength:
Current strength of the control. For key presses: 0 or 100. For analog stick or trigger movement (state = CONS_Moved): 0 to PLRCON_MaxStrength.
repeated:
Whether the call is generated because of a held button.
state:
State of the key press. Possible values:
Constant Description
CONS_Down Key has been pressed down.
CONS_Up Key has been released. Only generated for held keys.
CONS_Moved An analog control on a gamepad has been moved. Only generated for held keys.
See also: GetPlayerControlState
See also: Player Controls
Luchs, 2016-02