---
title: Core Controller Functions
slug: gpc/gpc-scripting-core-controller-functions
description: Here is the list of Core Controller Functions.
icon: ◽
docTags: 
createdAt: 2021-12-08T18:04:48.000Z
---

| Function Name      | Description                                                                                                                                 |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| get\_val           | Returns the current value of a controller entry.                                                                                            |
| get\_lval          | Returns the previous value of a controller entry.                                                                                           |
| get\_ptime         | Returns the elapsed time of a controller entries state change.                                                                              |
| get\_controller    | Returns the type of controller currently connected to the input port.                                                                       |
| get\_battery       | Returns the current status of the battery for a wireless controller.                                                                        |
| event\_press       | Returns TRUE when a controller entry has been pressed.                                                                                      |
| event\_release     | Returns TRUE when a controller entry has been released.                                                                                     |
| get\_ival          | Gets the input value of a button to check if it has been modified by the script.                                                            |
| get\_brtime        | Gets the time the input value has been 0.                                                                                                   |
| swap               | Swaps the input values to be sent to the console temporarily.                                                                               |
| block              | locks the input from being sent to the console for the specified time.                                                                      |
| sensitivity        | Changes the input sensitivity.                                                                                                              |
| deadzone           | Modifies the inner "deadzone", and essentially pushes the starting value (when not 0) from the center by deadzone\_x/deadzone\_y or radius. |
| stickize           | Modifies outer deadzone, essentially forces the stick to not be further out than the radius from the inner point.                           |
| ps4\_touchpad      | Returns detailed information on the DualShock 4 touchpad state.                                                                             |
| ps4\_set\_touchpad | Touches the DualShock 4 touchpad in a specific (X, Y) position.                                                                             |
| turn\_off          | Turns off a wireless controller connected to the input port.                                                                                |
| wiir\_offscreen    | Returns TRUE if the IR sensor on a Wiimote is off screen.                                                                                   |
| get\_adt           | Returns the current value of an adaptive trigger entry.                                                                                     |
| set\_adt           | Sets the value of an adaptive trigger entry.                                                                                                |
| adt\_off           | Turns off an adaptive trigger. This will also reset any modifications done using set\_adt.                                                  |
| adt\_cmp           | Compares raw ADT data with an array that is used with addr.                                                                                 |
| addr               | Returns an offset rather than value.                                                                                                        |

# get\_val

`get_val` returns the current value of a controller entry in the form of an int.  This value represents a percentage %. &#x20;
GPC supports treating an int as a boolean value.  This means get\_val can be used to test whether a controller button, trigger, or stick is being pressed or not. For example:&#x20;

:::CodeblockTabs
GPC

```apex
if(get_val(PS4_R1))
```
:::

This **conditional statement¹** would return TRUE if R1/RB has a value other than 0 (zero).
It can also be used to check for a specific value or value **range²**. For example:

:::CodeblockTabs
GPC

```apex
if(get_val(PS4_R2) > 50)
```
:::

Would return TRUE if R2/RT was being pressed more than 50% of its total range.
Since get\_val returns an int, the returned value can be stored in a variable, like so:

:::CodeblockTabs
GPC

```apex
int myvar;

main {
    
    myvar = get_val(XB1_LT);
}
```
:::

🔴 **Syntax**

:::BlockQuote
get\_val ( \<identifier> );
:::

⚪&#x20;**Parameters**

\<identifier> : the identifier of a controller entry.

🔵&#x20;**Returns**

The current value of the specified identifier.  Can range from -100 to +100 depending on the entry type.

[ ](https://beta.cronusmax.com/gpc/gpc-scripting-variables)

**Notes:**

:::hint{type="info"}
**Info:&#x20;**&#xB9;A **conditional statement** is a set of rules performed if a certain condition is met. It is sometimes referred to as an **If-Then** statement, because **IF** a condition is met, **THEN** an action is performed.
:::

:::hint{type="info"}
**Info:&#x20;**&#xB2;Buttons/Bumpers, Triggers and Sticks each have their own range of returned values.  Buttons/Bumpers will return either 0 (not pressed) or 100 (pressed).  Triggers will return a value range of 0 to 100, depending on whether a trigger is not pressed at all (0) or a percentage of how far the trigger is pulled.  Sticks return a value that represents it’s position along an axis (X/Y).  As such, the return range of a stick is -100 to 100.
:::

# get\_lval

`get_lval` is similar to get\_val with the exception that it returns the value of the specified identifier in the previous iteration (run) of the main loop. This value is also returned as an int and represents a percentage %.
However, get\_lval gets its data from the input report so, unlike get\_val,  is not affected by any code before it.  For example, if you were to use the set\_val command to overwrite the output of an identifier, get\_lval would still return the previous value of the identifier.  You can see this in action by running the following command on your Cronus Zen and pressing the right trigger:

:::CodeblockTabs
GPC

```apex
main {
    
    set_val(XB1_RT, 0); 
    set_val(TRACE_1, get_lval(XB1_RT));    
    set_val(TRACE_2, get_val(XB1_RT));     
}
```
:::

🔴 **Syntax**

:::BlockQuote
**&#xD;**&#x67;et\_lval ( \<identifier> );
:::

⚪&#x20;**Parameters**

\<identifier> : the identifier of a controller entry.

🔵&#x20;**Returns**

The previous value of the specified identifier.  Can range from -100 to +100 depending on the entry type.

[Main Section](docId\:wCDBH9H0ggMrMgWTIYNI3)&#x20;

# get\_ptime

`get_ptime` returns the value in milliseconds of an identifiers state change in the form of an int.  What this means is when an identifiers value changes from FALSE to TRUE  or vice versa, the counter for get\_ptimeon that identifier is reset to 0.
Therefore the clock is always running for this function so it should be used with another command, such as get\_val.
For example, using get\_ptime in an if statement on its own like the example below would give an undesired result as the statement would be TRUE if the button was pressed or not for greater than 200 milliseconds.&#x20;

:::CodeblockTabs
GPC

```apex
if (get_ptime(XB360_A) > 200)
```
:::

Using get\_ptime in combination with the command get\_val would modify the statement to only return TRUE if the button had been pressed for longer than 200 milliseconds, as shown below;

:::CodeblockTabs
GPC

```apex
if (get_val(XB360_A) && get_ptime(XB360_A) > 200)
```
:::

🔴 **Syntax**

:::BlockQuote
get\_ptime ( \<identifier> );
:::

⚪&#x20;**Parameters**

\<identifier> : the identifier of a controller entry.

🔵&#x20;**Returns**

**&#xD;**&#x54;he elapsed time of a controller entry state changes. The value returned is in milliseconds with a range of 0 to 32767

# get\_controller

`get_controller` returns a value in the form of an int which represents the controller type currently connected to the input port of the Cronus. &#x20;
To save you from having to remember which value relates to the type of controller, the constants have been created. &#x20;

:::CodeblockTabs
GPC

```apex
main {

    if(get_controller() == PIO_XB1) {   // if the connected device is an XB1
                                        // controller, this will evaluate to TRUE
                                        // and code inside will execute.
    }
}
```
:::

🔴 **Syntax**

:::BlockQuote
get\_controller();
:::

⚪&#x20;**Parameters**

None

🔵&#x20;**Returns**

A value representing which type of controller is currently connected

# get\_battery

`get_battery` returns the battery level, if applicable, of the connected controller in the form of an *int* ranging from 0 to 11.  With 0 being discharged, 10 being fully charged and 11 being charging.

If no battery is connected, for example, a wired controller is connected, then it returns 10.

:::CodeblockTabs
GPC

```apex
main { 
       
    if(get_battery() <= 2) {    
    }
}
```
:::

🔴 **Syntax**

:::BlockQuote
**&#xD;**&#x67;et\_battery();
:::

⚪&#x20;**Parameters**

None

🔵&#x20;**Returns**

A value ranging from 0 (Discharged) to 10 (Fully Charged) or 11 if charging

# event\_press

`event_press` returns TRUE in the main iteration when a control changes from FALSE to TRUE.  Therefore, even if a button is pressed and held down, event\_press would only return TRUE at the moment it is pressed and not while the button was held.  This makes it perfect for combos you only wish to run once when a button is pressed.
For example, if you were playing a first person shooter, using a sniper rifle and you wanted the Cronus to automatically scope when you aimed down your sights.  You could do this:

:::CodeblockTabs
GPC

```apex
main {

    if(event_press(XB1_LT)){
        combo_run(scope_in);   
    }

}

combo scope_in {
    wait(400); 
    set_val(XB1_LS, 100);
    wait(200); 
}
```
:::

🔴 **Syntax**

:::BlockQuote
event\_press ( \<identifier>);
:::

⚪&#x20;**Parameters**

\<identifier> : the identifier of a controller entry

🔵&#x20;**Returns**

Returns TRUE in the main iteration when a control value changes from FALSE to TRUE.

[Main Section](docId\:wCDBH9H0ggMrMgWTIYNI3)

# event\_release

`event_release` is the opposite of event\_press, it returns TRUE in the main iteration when a control changes from TRUE to FALSE.  This makes it ideally suited to run code that you only want to run once when a button is released.
For example, if you were playing a shooter game and wanted the gun to be automatically reloaded whenever you stopped shooting, you could do this;

:::CodeblockTabs
GPC

```apex
main {
    
    if(event_release(XB1_RT)){
        combo_run(reload);   
    }
}

combo reload {
    wait(200); 
    set_val(XB1_X, 100);
    wait(200); 
}
```
:::

🔴 **Syntax**

:::BlockQuote
event\_release ( \<identifier> );
:::

⚪&#x20;**Parameters**

\<identifier> : the identifier of a controller entry

# get\_ival

`get_ival` gets the input value of a button to check if it has been modified by the script.

:::CodeblockTabs
GPC

```apex
main {

    if(get_ival(XB1_A) && get_ptime(XB1_A) < 500){
      set_val(XB1_UP,100);
    }
}
```
:::

# get\_brtime

`get_brtime` can be used to simplify double pressing a button like so;&#x20;

:::CodeblockTabs
GPC

```apex
main{

    if (event_press(XB1_A) && get_brtime(XB1_A) < 300) { 
        / Do something / 
    }
}
```
:::

That would only trigger when X**B1\_A** has been released less than 300ms (which would happen for a rapid press, release, press cycle)it's a companion to `get_ptime` which gets the press time... it works by checking how long it has been since the last time the button was last pressed (meaning, if used with event\_release it would result in the timings being off from the point of releasing the button).

# swap

`swap` does as the name implies, it swaps the values of two controller entries. This makes it useful for remapping buttons on the fly.
For example, if you were playing a shooter game that zooms the scope with a Right Stick Click when you Aim Down the Sights but you wished to move that function to the Right Bumper Button so it does not interfere with your aiming, you could do this:

:::CodeblockTabs
GPC

```apex
main {
 
    if(get_val(XB1_LT)) { // If LT / L2 is pressed...
 
        swap(XB1_RS, XB1_RB); // Swap RS /R3 and RB / R2
 
    }
 
}
```
:::

With the above code, whenever LT / L2 is pressed, RB / R2 will press the Right Stick click and vice versa.

&#x20;🔴 **Syntax**

:::BlockQuote
swap ( \<identifier1> , \<identifier2> );&#x20;
:::

⚪&#x20;**Parameters**

\<identifier1>   : the identifier of a controller entry                                      &#x20;

\<identifier2>   : the identifier of a controller entry

# block

`block` prevents the forwarding of a controller entry for a set period of time which is set in milliseconds.  This time can range from 20 to 4000 milliseconds.  It is extremely useful when you wish to get two uses from a single button. For example, if you were playing a platform game and wished for the Cronus Zen to automatically perform a double jump for you if you held the button down, you could do this:

:::CodeblockTabs
GPC

```apex
main {
 
    if(get_val(XB1_A)){  // If A / Cross is held...
       
        if(event_press(XB1_A)){  // When first pressed....
            combo_run(single_jump); // Run combo single jump
        }
        block(XB1_A, 500); // Block the forwarding of A / Cross from the controller for 500 ms
   
    }
 
}
 
combo single_jump {
 
    set_val(XB1_A, 100);
    wait(300);
 
}
```
:::

The above code will run the **combo** single\_jump as soon as the button is pressed.  If the button is released within 500 milliseconds then there is no further output to the console.  However, if the button is held for longer than 500 milliseconds then the normal output of that button resumes. Output with a quick tap of the button:

![](https://api.archbee.com/api/optimize/IwUlH55FdaPsVELSqm1Fc/J13IIQlCtUIujKfbViId2_image.png)

Output when the button is held;

![](https://api.archbee.com/api/optimize/IwUlH55FdaPsVELSqm1Fc/-d_Hede9SP4bJLTQIdqvO_image.png)

&#x20;🔴 **Syntax**

:::BlockQuote
**&#xD;**&#x62;lock ( \<identifier> , \<milliseconds> );
:::

⚪&#x20;**Parameters**

\<identifier>   : the identifier of a controller entry                                 &#x20;

\<milliseconds> : Length of time in milliseconds to block forwarding for. &#x20;

Allowed range 20 \~ 4000

# sensitivity

`sensitivity` adjusts the sensitivity of an analog controller entry, usually, this is an axis.&#x20;
The function takes three parameters, the control to be modified, the midpoint, and the sensitivity multiplier.&#x20;
Midpoint sets the midpoint value of the controller entry.  The default value is 50%.  By changing this value, you are setting two sensitivity ranges.  With a value lower than 50% a high sensitivity range is created closer to the rest position and a low sensitivity range when far from the rest position.  A value above 50% creates the opposite effect.&#x20;
The Sensitivity multiplier is the amount the input value is multiplied by.  The parameter is passed in percentage.  So 40 would mean multiply by 0.40, 100 means multiply by 1.00, and 140 means multiply by 1.40.&#x20;
How these translate into the difference between the input into the Cronus Zen and the output to the console can be seen below.&#x20;
With a midpoint of 35% and a sensitivity of 100 using the command - sensitivity(XB1\_LX, 35, 100);

![](https://api.archbee.com/api/optimize/IwUlH55FdaPsVELSqm1Fc/BhAtT-vGbIZgeFMc8sZEX_image.png)

With a midpoint of 70% and a sensitivity of 140 using the command - sensitivity(XB1\_LX, 70, 140);

![](https://api.archbee.com/api/optimize/IwUlH55FdaPsVELSqm1Fc/_3XSZ-gn7JUWNq4unbihx_image.png)

🔴 **Syntax**

**&#xD;**&#x73;ensitivity ( \<identifier> , \<midpoint> , \<sensitivity> );&#x20;

⚪&#x20;**Parameters**

\<identifier>   : the identifier of a controller entry                                           &#x20;

\<midpoint>     : sets the midpoint value                                                      &#x20;

\<sensitivity>  : the ratio of the sensitivity adjustment

# deadzone

`deadzone` adjusts the values of the output to alter the deadzone of two axis. The default deadzone programmed into consoles is 20%, which means a console will ignore any signal from an analog stick that is below 20%. The CronusZEN can adjust the output signals relative to the input.
For example, if you wished to remove 10% of the deadzone, the CronusZEN will output an additional 10% on both axis with the command:

:::CodeblockTabs
GPC

```apex
deadzone(XB1_LX, XB1_LY , 10, 10);
```
:::

With the above command, a physical movement of 10% on the Left stick of either the Horizontal or Vertical Axis would output as 20%. An additional 10% is added to the output up until 90%. Any movement from 90% or greater will output 100%, as shown on the graph below:

![](https://api.archbee.com/api/optimize/IwUlH55FdaPsVELSqm1Fc/uHyjS2yMPki_0JkEwIiDo_image.png)

The above code will create a square deadzone, which means 10% will be applied to Left Stick at all times.  However, the deadzone function can also be used to create a circular deadzone using the predefined constant, DZ\_CIRLCE (which equals 101). When you use DZ\_CIRCLE (or 101) in the third parameter instead of a value, the forth parameter then sets the radius of the circle instead of the value for the Y axis. Example when using the DZ\_CIRCLE constant;

:::CodeblockTabs
GPC

```apex
deadzone(XB1_LX, XB1_LY , DZ_CIRCLE , 10);
```
:::

🔴&#x20;**Syntax**

deadzone ( \<identifier\_x> , \<identifier\_y> , \<dzone\_x> / DZ\_CIRCLE , \<dzone\_y> / \<radius> );&#x20;

⚪&#x20;**Parameters**

**&#xD;**\<identifier\_x> : a controller entry which represents an X axis            &#x20;

\<identifier\_y>  : a controller entry which represents a Y axis                 &#x20;

\<dzone\_x> / DZ\_CIRCLE : X axis deadzone value / DZ\_CIRCLE constant  &#x20;

\<dzone\_y> / \<radius>  : Y axis deadzone value / The radius value of the circle

# sticksize

`stickize` transforms the values of a Wiimote IR or mouse input to an analog stick. It does this by setting the radial output of the translation from their movements to the analogue stick.

As the PS3 has a square output for its analog sticks, we recommend a value of 129 is used on that console. The Xbox 360, Xbox One, and PS4 all use a radial output so we recommend a value of 113 is used on those consoles.

🔴 **Syntax**

stickize ( \<identifier\_x> , \<identifier\_y> ,  \<radius> );&#x20;

⚪ **Parameters**

\<identifier\_x>  : a controller entry which represents an X axis         &#x20;

\<identifier\_y>  : a controller entry which represents a Y axis

\<radius>          : The radius value of the circle.

# ps4\_touchpad

`ps4_touchpad` returns detailed information on the current state of the touchpad.  Like get\_val, it returns an int.  ps4\_touchpad can give you information on where two fingers are positioned on the touchpad and their X / Y coordinates. This is done via six constants;

| PS4T\_ Constant | Value | Returns                                                          |
| --------------- | ----- | ---------------------------------------------------------------- |
| PS4T\_P1        | 1     | TRUE if at least one finger is on the touchpad, FALSE if none    |
| PS4T\_P1X       | 2     | X axis value of the first finger on the touchpad                 |
| PS4T\_P1Y       | 3     | Y axis value of the first finger on the touchpad                 |
| PS4T\_P2        | 16    | TRUE if two fingers are on the touchpad, FALSE if less than two. |
| PS4T\_P2X       | 32    | X axis value of the second finger on the touchpad                |
| PS4T\_P2Y       | 48    | Y axis value of the second finger on the touchpad                |

To get the value of one of the above constants, simply use it in the ps4\_touchpad parameter.  For example, to read the state of all the constants, you could do this:

:::CodeblockTabs
GPC

```apex
main {
 
    if(ps4_touchpad(PS4T_P1)) {  // If at least one finger is on touchpad...
        set_val(TRACE_1, 1); // Set TRACE_1 to 1
        set_val(TRACE_2, ps4_touchpad(PS4T_P1X)); // Set TRACE_2 to X coordinate of touchpoint 1
        set_val(TRACE_3, ps4_touchpad(PS4T_P1Y)); // Set TRACE_3 to Y coordinate of touchpoint 1
    } else { // If no fingers are on the touchpad...
        set_val(TRACE_1, 0); // Set TRACE_1 to 0
    }
   
    if(ps4_touchpad(PS4T_P2)) { // If two fingers is on touchpad...
        set_val(TRACE_4, 1); // Set TRACE_4 to 1
        set_val(TRACE_5, ps4_touchpad(PS4T_P2X)); // Set TRACE_5 to X coordinate of touchpoint 2
        set_val(TRACE_6, ps4_touchpad(PS4T_P2Y)); // Set TRACE_6 to Y coordinate of touchpoint 2
    } else { // If less than two fingers on the touchpad...
        set_val(TRACE_4, 0); // Set TRACE_4 to 0
    }
 
}
```
:::

🔴 **Syntax**

**&#xD;** ps4\_touchpad ( \<PS4T\_constant> );&#x20;


​⚪&#x20;**Parameters**

\<PS4T\_constant> : A constant from the table above&#x20;

🔵&#x20;**Returns**

**&#xD;**&#x41;n int value related to the PS4T\_ constant used

# ps4\_set\_touchpad

`ps4_set_touchpad` will touch the DualShock 4 touchpad in a specific (X, Y) position.&#x20;

:::CodeblockTabs
GPC

```apex
combo Touch_And_Click_DS4Touchpad {
 
    ps4_set_touchpad(90, 45);
    set_val(PS4_TOUCH, 100);
    wait(80); 
 
}
```
:::

🔴 **Syntax**

**&#xD;**&#x70;s4\_set\_touchpad ( \<X Value>, \<Y Value> )&#x20;

⚪&#x20;**Parameters**

**&#xD;**\<X Value> : X position in the DualShock 4 touchpad, ranging from -100 to 100.\<Y Value> : Y position in the DualShock 4 touchpad, ranging from -100 to 100.&#x20;

🔵&#x20;**Returns**

**&#xD;**&#x4E;one

# turn\_off

`turn_off` will switch off a wireless controller connected to the CronusZEN input port. Example of usage:&#x20;

:::CodeblockTabs
GPC

```apex
main {
 
    if(event_press(XB1_RS)) { // If RS / R3 is pressed...
        turn_off(); // Turn off wireless controller
    }
 
}
```
:::

&#x20;🔴 **Syntax**

turn\_off ( );&#x20;

⚪ **Parameters**

None

# wiir\_offscreen

`wii_offscreen` checks to see if the Wiimote controller is pointing off screen.
Example of usage:

:::CodeblockTabs
GPC

```apex
main {
 
    if(wii_offscreen()) {
        // Do Something
    }
 
}
```
:::

&#x20;🔴 **Syntax**

**&#xD;** wii\_offscreen ( );&#x20;


​⚪&#x20;**Parameters**

**&#xD;**&#x4E;one

&#x20;🔵&#x20;**Returns**

**&#xD;**&#x54;RUE if the Wiimote IR is pointing off screen, FALSE if it is not

# get\_adt

`get_adt` returns the current value of an adaptive trigger entry.  The raw values can also be viewed in Device Monitor by clicking **Toggle PS5 ADT** on the bottom right of the Device Monitor window. get\_adt can be used to assign a value to the following.

- **PS5\_ADT\_MODE (Can be viewed in Device Monitor)**
- **PS5\_ADT\_NR**
- **PS5\_ADT\_CR**
- **PS5\_ADT\_SR**
- **PS5\_ADT\_EF1**
- **PS5\_ADT\_EF2**
- **PS5\_ADT\_OFF**
- **PS5\_ADT\_START (Can be viewed in Device Monitor)**
- **PS5\_ADT\_FORCE1 (Can be viewed in Device Monitor)**
- **PS5\_ADT\_FORCE2 (Can be viewed in Device Monitor)**
- **PS5\_ADT\_STRENGTH\_LOW (Can be viewed in Device Monitor)**
- **PS5\_ADT\_STRENGTH\_MID (Can be viewed in Device Monitor)**
- **PS5\_ADT\_STRENGTH\_HIGH (Can be viewed in Device Monitor)**
- **PS5\_ADT\_FREQ (Can be viewed in Device Monitor)**
  As seen above not all entries can be viewed in Device Monitor although entries that can have a more substantial impact are visible. Example Useage:&#x20;

:::CodeblockTabs
GPC

```apex
if(get_adt(PS5_R2, PS5_ADT_MODE) == 0x26)
```
:::

This **conditional statement¹** would return TRUE if R2 has a value of 0x26. This is a common value that R2 has when firing a weapon in most shooters such as MWIII
It can also be used to check for a specific value or value **range²**. For example:

:::CodeblockTabs
GPC

```apex
if(get_adt(PS5_R2, PS5_ADT_MODE))
```
:::

Would return TRUE if R2 has a value other than 0 (zero). However, it is not recommended to do this when reading **PS5\_ADT\_MODE** as you will notice a value of 0x05 will be present if connected to a PS5 console when powered on and most shooters such as MWIII will also report a value of 0x25 when R2 is not being pressed.
Below is an example for MWIII where if R2 is not held TRACE\_1 is set to 1. Whereas if R2 is held TRACE\_2 is set to 2:

:::CodeblockTabs
GPC

```apex
main {

	if(get_adt(PS5_R2, PS5_ADT_MODE) == 0x25){
    	set_val(TRACE_1,1);
    }
	if(get_adt(PS5_R2, PS5_ADT_MODE) == 0x26){
    	set_val(TRACE_1,2);
    }

}
```
:::

🔴 **Syntax**

:::BlockQuote
get\_adt ( \<trigger>, \<identifier> );
:::

⚪&#x20;**Parameters**

\<trigger> : Adaptive trigger can be either PS5\_L2 or PS5\_R2.

\<identifier> : the identifier of an adaptive trigger.

🔵&#x20;**Returns**

The current value of the specified identifier.  Can range from 0 to +255 depending on the entry type.

[ ](https://beta.cronusmax.com/gpc/gpc-scripting-variables)

**Notes:**

:::hint{type="info"}
**Info:&#x20;**&#x49;f is important to note for get\_adt to function correctly you will need Adaptive Trigger support enabled in the game being played. This option can go by a few different names such as Adaptive Triggers, Full Haptics etc
:::

# set\_adt

`set_adt` can set a value of 0 to 255 to any adaptive trigger identifier covered in get\_adt.  Values to an Adaptive Trigger will override the rumble feeling felt from a game. An example can be seen below where both triggers have all aspects of the trigger set to 0. This can be useful if you need to read adt data from a game but would like to prevent the Adaptive Triggers from being psychically felt.

:::CodeblockTabs
GPC

```apex
main {

	set_adt(PS5_R2, PS5_ADT_MODE,0x00);
	set_adt(PS5_R2, PS5_ADT_START,0x00);
	set_adt(PS5_R2, PS5_ADT_FORCE1,0x00);
	set_adt(PS5_R2, PS5_ADT_FORCE2,0x00);
	set_adt(PS5_R2, PS5_ADT_STRENGTH_LOW,0x00);
	set_adt(PS5_R2, PS5_ADT_STRENGTH_MID,0x00);
	set_adt(PS5_R2, PS5_ADT_STRENGTH_HIGH,0x00);
	set_adt(PS5_R2, PS5_ADT_FREQ,0x00);
					
	set_adt(PS5_L2, PS5_ADT_MODE,0x00);
	set_adt(PS5_L2, PS5_ADT_START,0x00);
	set_adt(PS5_L2, PS5_ADT_FORCE1,0x00);
	set_adt(PS5_L2, PS5_ADT_FORCE2,0x00);
	set_adt(PS5_L2, PS5_ADT_STRENGTH_LOW,0x00);
	set_adt(PS5_L2, PS5_ADT_STRENGTH_MID,0x00);
	set_adt(PS5_L2, PS5_ADT_STRENGTH_HIGH,0x00);
	set_adt(PS5_L2, PS5_ADT_FREQ,0x00);

}
```
:::

🔴 **Syntax**

:::BlockQuote
**&#xD;**&#x73;et\_adt ( \<trigger>, \<identifier> );
:::

⚪&#x20;**Parameters**

\<trigger> : Adaptive trigger can be either PS5\_L2 or PS5\_R2.

\<identifier> : the identifier of a controller entry.

🔵&#x20;**Sets**

Set the output value an an Adaptive Triggger.

# adt\_off

`adt_off` can be used to turn off the adaptive triggers. This will also reset both triggers to their default state. The function can be helpful in clearing the effects done to the adaptive triggers using set\_adt

:::CodeblockTabs
GPC

```apex
main{

    adt_off(); // Reset L2 and R2 to their default state
}
```
:::

