Edges, holds, and releases
Last updated
main {
if(event_press(PS5_CROSS)) {
set_val(TRACE_1, 1);
}
}main {
if(event_release(PS5_CROSS)) {
set_val(TRACE_1, 0);
}
}main {
if(get_ival(PS5_OPTIONS) && get_ptime(PS5_OPTIONS) >= 800) {
set_val(TRACE_1, 1);
}
}get_ptime resets when the control changes truth state. It is suited to hold duration, not precision scheduling.
Always device-test the first press after script load and the exact threshold boundary.
Last updated
main {
if(event_press(PS5_CROSS) && get_brtime(PS5_CROSS) < 300) {
set_val(TRACE_1, 2);
}
}
