1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2024-11-28 08:20:51 +01:00

vigem-iidxio: Improve responsiveness on fast direction change TT

This commit is contained in:
icex2 2020-12-31 16:03:57 +01:00
parent 12c52bb0d8
commit de0d70d808

View File

@ -131,6 +131,14 @@ static int16_t _handle_turntable_as_button(
printf("delta_button %d, ", delta); printf("delta_button %d, ", delta);
} }
// TT direction changed suddendly -> fast scratchin' action like a real DJ
// Reset state to avoid lag with state having to decrease from high values
if (delta > 0 && delta >= config->tt.button.threshold && state < 0) {
state = 0;
} else if (delta < 0 && abs(delta) >= config->tt.button.threshold && state > 0) {
state = 0;
}
// Update state according to delta, debounce and max values // Update state according to delta, debounce and max values
if (delta > 0 && state < btn_max) { if (delta > 0 && state < btn_max) {
state += btn_inc; state += btn_inc;