A solution for the problem of changing the render mode too fast is the use of a timer. Each time we press the R key, a timer is started, and only after enough time has passed, will we process another R key press.
18.222.196.175