> For the complete documentation index, see [llms.txt](https://guide.cronuszen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.cronuszen.com/gpcscripting/gpc-script-guide/inputs-and-outputs/blocking-swapping-sensitivity-and-deadzone.md).

# Blocking, swapping, sensitivity, and deadzone

### Swap values

`swap(a, b)` exchanges the two identifiers' **current working values for this report**. It does not permanently remap the controls and must run again on every cycle where the swap should apply.

```cpp
main {
    if(get_ival(PS5_L2)) {
        swap(PS5_CROSS, PS5_CIRCLE);
    }
}
```

***

### Block one control

`block(id, milliseconds)` starts a timed block for one identifier. The block continues across later VM cycles for the requested duration, so an edge event can start it once.

```cpp
main {
    if(event_press(PS5_CROSS)) {
        block(PS5_CROSS, 250);
    }
}
```

***

### Block the whole cycle

`block_all_inputs()` blocks all controller outputs for the **current main cycle only**. It is not the timed, all-controls version of `block`. Call it every cycle while an exclusive menu/tester state owns the controller.

```cpp
int menu_open;

main {
    if(menu_open) {
        block_all_inputs();
    }
}
```

| Function             | Scope                                | Lifetime                                          |
| -------------------- | ------------------------------------ | ------------------------------------------------- |
| `block(id, time)`    | One controller identifier            | Timed across cycles                               |
| `block_all_inputs()` | All controller outputs               | Current cycle only                                |
| `block_rumble()`     | Console-to-controller rumble channel | Separate feedback control; see Rumble and haptics |

***

### Interaction with polar output

`block_all_inputs()` effectively writes `0` to every controller output. If you call `set_polar()` later in the same cycle, nonzero physical input on either axis of the target stick can override the corresponding polar axis. Restore both target-stick axes from the unmodified input immediately before the polar write:

{% code title="polar-after-block-all.gpc" %}

```cpp
int menu_open;

main {
    if(menu_open) {
        block_all_inputs();

        // Restore both right-stick axes before the polar write.
        set_val(PS5_RX, get_ival(PS5_RX));
        set_val(PS5_RY, get_ival(PS5_RY));
        set_polar(POLAR_RS, 90, 12000);
    }
}
```

{% endcode %}

For `POLAR_LS`, restore the left-stick X and Y identifiers instead. Keep `set_polar()` after those two `set_val()` calls. This restoration is needed for cycles that combine `block_all_inputs()` with a physical-stick polar write; it is not required for ordinary polar output that does not block every input first.

***

### Sensitivity

```cpp
main {
    sensitivity(PS5_RX, NOT_USE, 120);
    sensitivity(PS5_RY, NOT_USE, 120);
}
```

Live uses three parameters. The old six-parameter form is not current.

The third parameter is a percentage: `100` leaves the value unchanged, values above `100` amplify movement, and values below `100` reduce it. `NOT_USE` keeps the default midpoint; otherwise the midpoint changes where the response curve bends.

***

### Inner deadzone

`deadzone` does not merely ignore a region around center. A zero input remains zero, while a nonzero input is pushed outward so its minimum output begins at the requested X/Y offset or circular radius. This can overcome a game's own inner deadzone, but a large value also makes small movements jump abruptly.

```cpp
main {
    deadzone(PS5_RX, PS5_RY, DZ_CIRCLE, 20);
}
```

With `DZ_CIRCLE`, the fourth argument is the circular radius. Without it, the third and fourth arguments are the separate X and Y offsets.

***

### Outer shape/radius

`stickize` changes the outer stick boundary. A radius of `141` expands a circular stick range toward the corners of a square output area; lower values limit how far the output can extend.

```cpp
main {
    stickize(PS5_RX, PS5_RY, 141);
}
```

Order affects composition. If sensitivity, deadzone, stick shaping, direct axis writes, and polar output all touch the same stick, define the pipeline and keep one final stage.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://guide.cronuszen.com/gpcscripting/gpc-script-guide/inputs-and-outputs/blocking-swapping-sensitivity-and-deadzone.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
