update. the problem happened again but this in rdr2 and doom eternal and nier automata and after a lot of search i found another solution that has been woriking for now. you need to go to control panel then keyboard and lower the repeat rate.
(hello i had the same problem and i went to device manager and keyboard. it showed that there is four keyboard or four diffrent programms and i uninstalled three of them and the problem went away.)