For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

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.

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.

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:

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

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.

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.

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.

Last updated