i've heard good things about using the 1 euro filter for user input related tasks, where you're trying to effectively remove noise, but also keep latency down.
see https://gery.casiez.net/1euro/ with plenty of existing implementations to pick from
see https://gery.casiez.net/1euro/ with plenty of existing implementations to pick from