File: GetPlayerControlState.xml

package info (click to toggle)
openclonk 8.1-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 169,520 kB
  • sloc: cpp: 180,479; ansic: 108,988; xml: 31,371; python: 1,223; php: 767; makefile: 145; sh: 101; javascript: 34
file content (46 lines) | stat: -rw-r--r-- 1,878 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?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>
    <version>5.1 OC (extended in 8.0 OC)</version>
    <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>
        <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>
      </params>
    </syntax>
    <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>
    <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>
  <author>Luchs</author><date>2016-02</date>
</funcs>