2015-10-15 16:05:21 +00:00
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
< !DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs >
<func >
<title > GetPlayerControlState</title>
<category > Player</category>
2016-02-18 19:57:46 +00:00
<version > 5.1 OC (extended in 8.0 OC)</version>
2015-10-15 16:05:21 +00:00
<syntax >
<rtype > int</rtype>
<params >
<param >
<type > int</type>
<name > player</name>
<desc > Number of the player whose control state you want to query.</desc>
</param>
<param >
<type > int</type>
<name > control</name>
<desc > Control to query. A CON_* constant should be used here.</desc>
</param>
2016-02-18 19:57:46 +00:00
<param >
<type > bool</type>
<name > analog_strength</name>
<desc > If true: Query current state of an analog control on a gamepad instead of the emulated button state.</desc>
<optional />
</param>
2015-10-15 16:05:21 +00:00
</params>
</syntax>
2016-02-18 19:57:46 +00:00
<desc > 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).</desc>
2015-10-15 16:05:21 +00:00
<examples >
<example >
<code >
if (GetPlayerControlState(GetOwner(), CON_Left) != 0)
Log("You are currently holding down the left cursor key!");</code>
<text > Prints a message when the player is holding down the key assigned to the control CON_Left.</text>
</example>
</examples>
<related >
<funclink > GetPlayerControlAssignment</funclink>
</related>
</func>
<author > Zapper</author> <date > 2015-10</date>
2016-02-18 19:57:46 +00:00
<author > Luchs</author> <date > 2016-02</date>
2015-10-15 16:05:21 +00:00
</funcs>