Blocking, swapping, sensitivity, and deadzone
Last updated
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(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_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.
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
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.
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.
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.
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
int menu_open;
main {
if(menu_open) {
block_all_inputs();
}
}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);
}
}main {
sensitivity(PS5_RX, NOT_USE, 120);
sensitivity(PS5_RY, NOT_USE, 120);
}main {
deadzone(PS5_RX, PS5_RY, DZ_CIRCLE, 20);
}main {
stickize(PS5_RX, PS5_RY, 141);
}
